Git use basis (b)

1. View current branch and all local branches, the prefix * branch is the current branch is located

git branch

2. Check the branch command help document, it will open the help file or in the current terminal in linux macos, the windows will automatically start the default browser and open the document

git branch --help

3. Create a new branch from the current branch

git branch (the new branch name)

4. Switch to the specified branch

git checkout (designated branch name)

5. Delete the specified branch

git branch -d (designated branch name) // not merged into the master branch or other branches, will be allowed to delete

6. forcibly remove branches, the operation must be cautious

git branch -D (designated branch name)

7. Merge branch to branch into specified current branch

git merge (specified branch name)

8. Modify the specified branch

git branch -m (designated branch name)

Guess you like

Origin www.cnblogs.com/devinzh/p/11846336.html