Has anyone got a good strategy for keeping your race code up to date. I want to keep my code and the race code (which I may edit) in a private repository of my own, but then how do I keep up to date with changes to the original code? Does this just have to be a manual process, or has anyone done something clever?
Thanks!
I just created a local branch, called 'geoff' in mt case, on git:
Then do all my work on that branch, committing my changes to the branch:
but not pushing the branch to the server (the server would reject it anyway because we only have read access).
When an update to the main source is available, then I fetch the updates:
and merge them into my working branch
These latter two steps can be combined in a single
git pull origin
, but it's easier to explain what is happening in two steps.Hope that helps.
Geoff
I was half-way through writing a long-winded explanation when I saw your reply.
As yours is easier to read I will admit surrender :)
One thing which is still worth adding is about merge conflicts.
Merge conflicts occur when a file has changed in both places in a way that Git cannot solve on its own.
For example if we have updated the
autoGainMax
setting and you have as well.In this case Git does not know which value to use and you will see something like this:
Auto-merging is fine, it is just when you see the
CONFLICT
message that a problem needs to be fixed.The conflicted file will now have some slightly odd lines, like this:
In this case
HEAD
is your version, which are all the lines above the=======
mark.All the lines below the
=======
mark areorigin/master
, our updated version.Change the file to be correct again by replacing all of the text including the
<<<<<<<
and>>>>>>>
lines with what you want to keep.Then commit the fix to finish the process:
There is a good reference (if a little dry) here: Basic Merge Conflicts.
Hehe... I've told people about using git before and found that if you bring up conflict resolution straight away, then they spend forever worrying about how they'll cope with that rather than taking the plunge :)
Geoff
Just what I was looking for - thanks guys!
Add new comment