Home » Questions » Computers [ Ask a new question ]

What is the best way to keep track of local changes to a project via Git while also keeping up with bug fixes?

What is the best way to keep track of local changes to a project via Git while also keeping up with bug fixes?

At the university where I work, we use an open source learning management system (Moodle). Over time, we've edited the source code directly to fix bugs we've found and provide custom functionality. I'd like to be able to keep up with the bug fixes via a Git repository while also keeping track of our changes and making sure that our edits are preserved.

Asked by: Guest | Views: 385
Total answers/comments: 1
Guest [Entry]

"Merging and rebasing are basically doing the same: making the last commit incorporate changes from both provided branches. But the way them do it is different.

Merging creates a commit that has two specified as parents, and rebasing 'moves' your tree so it's first commit is based (i.e. has one parent) on last commit of other branch (origin in your case). Resulting tree state is identical.

The right thing to do in this case is merge custom branch with origin:

git checkout custom
git merge origin

Rebasing is only useful if you want to send a bunch of patches to maintainer of projects so he doesn't need to adapt them to more recent changes manually.

Rebasing commands would be:

git checkout custom
git rebase origin

Also there is a git-cherry-pick(1) command that can be used to apply an arbitrary commit from any branch as a patch would be."