1. 程式人生 > >git上傳代碼,合並代碼,分支相關

git上傳代碼,合並代碼,分支相關

merge git push 冒號 master add check 到你 註釋 comm

1.上傳本地代碼到git:
(1)git remote add origin [email protected]:DaWang/wechat-waiwei-hunter-new.git
(2)git add .
(3)git commit -m "註釋"
(4)git push -u origin master

2.git分支合並到主幹
(1)提交分支代碼到分支,然後切換回主幹

(2)pull下所有代碼

(3)git merge xiahuyouhua02(分支名稱)

(4)push所有代碼

3.git主幹合並到分支
(1)提交分支代碼到本地倉庫,然後切回主幹

(2)pull下所有代碼,然後切回分支

(3)git merge master(主幹名稱)

4.git分支相關
在本地新建一個分支: git branch Branch1
切換到你的新分支: git checkout Branch1
將新分支發布在github上: git push origin Branch1
在本地刪除一個分支: git branch -d Branch1
在github遠程端刪除一個分支: git push origin :Branch1 (分支名前的冒號代表刪除)

git上傳代碼,合並代碼,分支相關