clone a repo:
get clone url --recursive
Create the branch on your local machine :
git branch <name_of_your_new_branch>
Push the branch on github :
git push origin <name_of_your_new_branch>
Switch to your new branch :
git checkout <name_of_your_new_branch>
Delete a branch on your local filesytem :
git branch -d <name_of_your_new_branch>
Delete the branch on github
git push origin :<name_of_your_new_branch>
Track remote branch:
git branch --track local_branch_name origin/remote_branch_name
git branch --set-upstream-to=origin/<branch> wl/chinese
push change to remote branch:
git push --set-upstream origin name_of_your_new_branch
git push --u origin name_of_your_new_branch
查看主分支最新提交的内容:
cat refs/heads/master | xargs git cat-file -p
合并分支(合并target_branch_name到当前分支)
git merge <target_branch_name>
回退
(1)
1. git branch <自定义分支名称> <版本号> 例如:git branch name 版本号
2. git checkout <分支>
(2)
git reset --hard 版本号
查看和配置环境
git config --list
git config --global user.name "yourname"
git config --global user.email "youremail"