In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. Create a branch
Git branch name
two。 Switch branch
Git checkout name
3. View Branch
Git branch
4. Merge branches into the current branch
Git checkout master # # switch to the master branch
Git checkout name # # merge branch name to master
5. Delete Branch
Git branch-d name
6. View branch merge records
Git log-graph-pretty=oneline-abbrev-commit
7. When merging segments, you can merge in normal mode by adding-- no-ff parameter. The history after the merger is divided, and you can see that there has been
If you have done a merger, if you have done a fast forward merger, you will not see that you have ever done a merger.
8.git stash
You can "store" the current work on the site, and then resume the work of the original branch after the site is restored later. Commonly used for bug repair
8.1 git stash list # # View History
8.2 git stash apply # # restore stash Workspace
8.3 git stash drop # # Delete stash Workspace
8.4 git stash pop # # while restoring the original work site and deleting
Feature division [mainly in the environment where the branch needs to be revoked and deleted after the branch is merged]
9.1 git checkout-b feature # # develop a new branch
9.2 git checkout dev # # back to the dev branch
9.3 git branch-d feature # # now the application requirements have changed, and the branch needs to be deleted [has not been merged into dev]
9.4 git branch-D feature # # forcibly delete branches
10. Label
10.1 git tag name is required to create a new tag. The default is HEAD, or you can specify a commit id.
10.2a tagname-m "blablabla..." You can specify label information
10.3-s tagname-m "blablabla..." You can use the PGP signature mark
10.4 git tag # View all commands
10.5 git tag-d tag_name # # Delete tags
10.6 git push origin tag_name # # push tags to remote
10.7 git push origin-tags # # all local tags that have not been pushed to a remote location
10.8 git push origin: refs/tags/tag_name # # remotely delete tag
11. Custom git
11.1 git config-- global color.ui true # # Let git display colors
12 ignore special accessories
Create a special .gitignore item under the root record of the Git operation area, and then fill in the name of the item you want to ignore, and Git will move to ignore them.
Then submit .gitignore to Git, and it's done! Of course. Gitignore's standard is git status.
Does the command say "working directory clean"?
13. Alias
Git config-- global alias.st status # # tap git st to indicate git status
Git config-global alias.co checkout
Git config-global alias.ci commit
Git config-global alias.br branch
Git config-global alias.lg "log-- color-- graph-- pretty=format:'%Cred%h%Creset -% C (yellow)% d%Creset% s% Cgreen (% cr)% C (bold blue)% Creset'-- abbrev-commit"
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.