
写代码时,要把公司仓库的代码clone到本地,在workspace路径下执行:
1
| git clone -b <branch_name> <repository>
|
分支操作:
1 2 3 4 5
| git branch git branch <branchName> git checkout <branch_name>
git checkout -b <branchName>
|
修改完代码提交到远程仓库分支中:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| git add . git commit -m <message>
git commit -am <message>
git push <远程主机名> <本地分支名>:<远程分支名> git push <远程主机名> <本地分支名>
git pull <remote> <branch>
git pull git merge master
git checkout . git reset HEAD <filename> git restore <finename> git reset --hard HEAD^
|