簡體   English   中英

git branch commit不會合並到master

[英]git branch commit does not merge into master

在git窗口中,我執行了以下命令:

git branch 
master
*wcopy

git commit -am "modified provider features"
On branch wcopy
Your branch is up to date with 'origin/wcopy'.

nothing to commit, working tree clean

git merge wcopy
Already upto date

git push origin master
Everything up-to-date

我去git hub倉庫分支主管說:最近提交9天前

分支wcopy說:該分支在前面提交2次,在master后面5次。 最新提交db8bdca 18分鍾前

我檢查了brnach wcopy代碼是最新的,但高手在后面。

我通過git命令合並到master中,但是它仍然顯示兩個單獨的分支,其中wcopy后面有master

(1)如何使大師保持最新狀態? (2)另外,我在源代碼上將文件DB / Model.xcdatamodeld重命名為Model.xcdatamodeld。 但是wcopy分支將路徑顯示為DB / Model.xcdatamodeld / GridModel.xcdatamodel,表示該路徑跳過了空目錄。 如果我查看源代碼上的實際代碼,它將正確顯示為DB / Model.xcdatamodeld的路徑,我不知道為什么會有所不同?

我通過git命令合並到master中,但是它仍然顯示兩個單獨的分支,其中wcopy后面有master

當您這樣做時:

git merge wcopy

您將wcopy合並到自身,即wcopy分支中,該分支當然不執行任何操作。 您應該先切換master分支,然后再進行合並:

git checkout master
git merge wcopy
# resolve possible merge conflicts...
git push origin master

而不是這樣做:

git merge wcopy

通過這樣做,您將wcopy合並到自身中(這不是您所需要的)。 您應該已經切換master分支,然后通過執行以下操作將合並的wcopy分支合並為master

git pull origin wcopy
# to make sure you are up to date on wcopy branch
git checkout master
# to have your master branch up to date with the remote.
git pull origin master
git merge wcopy
# resolve possible merge conflicts if any.
git push origin master

這樣可以解決所有問題,並將分支wcopymaster合並。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM