記錄git 一般使用命令
1.當本地的ssh密鑰加了密碼之后,在視圖工具sourceTree當中使用時會報錯
2.將遠程的倉庫拉取到本地啦逆,在指定的文件夾下伞矩,使用 git clone [倉庫名稱]
3.查看本地的分支git branch?
4.創(chuàng)建并切換到本地分支git checkout -b[分支名]
5.將遠程的分支拉取到本地:一:git fetch origin[遠程分支名]? 二:git checkout -b[本地分支名]origin/[遠程分支名]
6.將本地的新分支推送到遠程 : git push origin [本地分支名]:[遠程分支名]
? ? 也可以簡寫: git push origin [遠程分支名],則默認遠程和本地名稱一樣?
7.將遠程分支【oBranch】夏志,合并到本地分支【nBranch】:
1.現(xiàn)在本地創(chuàng)建遠程分支對應(yīng)的本地分支:git checkout -b[本地分支(如:oBranch)]origin/[遠程分支(如:oBranch)],
2.將遠程分支拉到本地:git pull origin[遠程分支(如:oBranch)]
3.切換到本地分支:git checkout[本地分支(如:nBranch)]
4.合并分支:git merge oBranch
5.同步本地分支nBranch到遠程:git push origin nBranch