Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm tracking my changes on a PHP-software with git. I have only a master branch and about 10 commits, the first commit was the original version 1.0 of the software.

Now I saw, that the owner of the PHP-software released version 1.1.

What is the best an easiest way for me, to update the software, but keep my own changes too and merge them with git mergetool? Should I use patches or create another branch with the untouched version updates?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
217 views
Welcome To Ask or Share your Answers For Others

1 Answer

Typical approach is to create a branch with local changes (say "local") on top of the software:

git checkout origin/master
git checkout -b local
....edit files....
git commit

now whenever there is upstream update, you can easily reapply changes using rebase:

git fetch
git rebase origin/master

If you already have some merge history in master branch, try doing it raw and use 'git diff' to produce a complete patch of your work against upstream -- such package can be simply applied even without git tools.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...