Assuming that project A is using git as its SCM. I clone their repo make changes suiting my needs, after that can i still pull updates from their repo and keep my changes?
Asked
Active
Viewed 133 times
3
-
See also http://stackoverflow.com/questions/804115/git-rebase-vs-git-merge and http://stackoverflow.com/questions/904353/unable-to-understand-git-branch-merge-and-rebase for more details on the rebase topic – VonC May 31 '09 at 06:45
3 Answers
5
A real nice way of doing this in git is to "rebase" your changes. What this does, instead of merging the updates from "their" repo into your changes, is it rewinds (undoes) all of your changes, puts their changes into your branch (so everything is nice and linear) and then "replays" your changes on top of theirs.
This results in your changes always basically being a series of "patches" on top of the repo you are following (instead of having your changes interleaved with their changes as you move back through the history).

Dan Moulding
- 211,373
- 23
- 97
- 98
-
maybe a good idea to document how this works, succinctly? Sure, it might be repetive, but for someone who's read the git docs and never seen this... would be useful to have it recorded somewhere. – Chris K May 31 '09 at 06:34
-
@darthcoder: http://stackoverflow.com/questions/804115/git-rebase-vs-git-merge and http://stackoverflow.com/questions/904353/unable-to-understand-git-branch-merge-and-rebase offer some kind of documentation on the "rebase" topic – VonC May 31 '09 at 06:46
3
I tend to build a branch for my changes and periodically rebase it atop the upstream code.

Dustin
- 89,080
- 21
- 111
- 133
1
Yes. Conflicting changes will be merged, which is basically the point of a good DVCS.

Matthew Flaschen
- 278,309
- 50
- 514
- 539