使用已经多次提交的文件
Working with file that has had several commits
我有一个我已经处理了很长时间的文件。我的老板让我在一个其他人一直在工作的分支机构工作。对我一直在处理的文件进行了多次提交。 How do I merge my changes into the file since it's had several commits now?
我还没有提取最近的提交。,
如果你还没有..我会确保从你的同事正在工作的这个共享分支(我们称之为 develop
)分支出来。
Re-apply 您在共享 develop
分支
的最新提交之上所做的更改
git pull --rebase origin develop
检查您的更改可能造成的任何冲突,解决它们。
git status
如果存在冲突,您需要将它们添加回暂存,并继续进行变基。根据冲突和你落后的程度,你可能需要多次执行此步骤。
git add <files_with_conflicts>
git rebase --continue
至此,您可以合并并分享您的更改。
git checkout develop
git merge <your_local_branch>
git push origin develop
我有一个我已经处理了很长时间的文件。我的老板让我在一个其他人一直在工作的分支机构工作。对我一直在处理的文件进行了多次提交。 How do I merge my changes into the file since it's had several commits now?
我还没有提取最近的提交。,
如果你还没有..我会确保从你的同事正在工作的这个共享分支(我们称之为 develop
)分支出来。
Re-apply 您在共享 develop
分支
git pull --rebase origin develop
检查您的更改可能造成的任何冲突,解决它们。
git status
如果存在冲突,您需要将它们添加回暂存,并继续进行变基。根据冲突和你落后的程度,你可能需要多次执行此步骤。
git add <files_with_conflicts>
git rebase --continue
至此,您可以合并并分享您的更改。
git checkout develop
git merge <your_local_branch>
git push origin develop