在主人那里,我有4个文件。
以git合并时间;
创建新合并:问题
我想合并两个分支; “ new1”和“ new2”。 “ new1”仅包含已编辑的文件1和2,而“ new2”仅包含文件3和4。
我的尝试:
相信我,我现在尝试使用50多个分支进行了50次以上,但仍然不知道为什么会发生。我真的希望有人能帮助我,如果 可能的话,请向这个初学者解释一些。我真的很希望。
我的尝试的简单草案:
git checkout -b new1/ git branch new1 - git checkout new 1
**edit new1**
git add file 1 and file 2
git commit
git push
git checkout -b new2/ git branch new2 - git checkout new2
**edit new2**
git add file 3 and file 4
git commit
git push
合并时,就像我的问题一样。我该怎么办?
我什至尝试过
git checkout -b new1/ git branch new1 - git checkout new 1
**edit new1**
git add file 1 and file 2
git commit
git push
git checkout -b new2/ git branch new2 - git checkout new2
**edit new2**
git add file 3 and file 4
git commit
git push
git checkout -b new3 # this to for saving "new2"
git rebase master # what is this even doing and i found in web said it is necessary
git cherry-pick # Honestly, in web it says to pick the commit you want but it TAKES EVERYTHING, example, commit 1, 2, 3, 4. when I cherry-pick commit 3. Somehow commit 1,2,3 also inside.
git add # the new file changes, I'm blue, I thought I cherry pick the commit which has the file but somehow it got conflict and ask me for edit then add that why here i add
git commit
git push