문제

Someone sent me the output of a diff of my remote and their local. My local is a clone of the remote with no changes. What is the best way to apply the diff to my local without manually going through it and making each change?

diff --git a/path b/path
도움이 되었습니까?

해결책

The git apply command will take a patch and apply it to your local directory. There is some good discussion here, and of course also the git-apply documentation.

다른 팁

It depends on your workflow you can use git apply to apply a properly formatted patch. Alternatively you could have the other party push to a shared branch git push origin <branch> and you could pull their branch down and merge/rebase the changes. Both of these are functionally equivalent, but the second option sports a little recordkeeping regarding your code sharing arrangement.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top