I am just learning how to use git and would like to follow a project. So I clone the project and no I have the most new code.
If I want to add a patch (or more) to that code, what is the best way to do that (and run make
and make install
) and still be able to git pull
from the master repo without creating a conflict?
I have tried making a branch, but I'm not sure if this is the right way.
I'd just like to be able to keep up with new code in master, but be able to apply my own patches as new versions are pushed.
I'd like to know where I can learn how to do this, but I'm not sure what to google for.
You are probably looking for git rebase
: Create a local branch from the remote tracking branch and invoke git config branch.mylocalbranch.rebase true
(where 'mylocalbranch' is the name of your local branch). Now you can make your local patches and commit them. Everytime you fetch updates with git pull
your local modifications are 'rebased' (applied on top of what you've just pulled).
Be careful not to push your local modifications (e.g. the HEAD of your local branch) to the remote as this is probably not what you want. See man git-rebase
for further details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With