purplecat: Hand Drawn picture of a Toy Cat (programming)
purplecat ([personal profile] purplecat) wrote in [site community profile] dw_dev_training2013-10-30 09:31 pm
Entry tags:

Git Logs and Merging develop into a branch

I'm about to push my latest bug fix to github. While I've been working on this bug there's been some changes to the main develop branch so, obviously, I want to merge these into my branch before I push my code and submit a pull request.

Now I recall that in the past I've been asked to clean up the log after doing this but I've forgotten the process for achieving that. If someone could post an idiots' guide in the comments that would be really useful!
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2013-10-31 01:02 pm (UTC)(link)
For both of these, I'd suggest rebase instead!

What I'd do:

# take all your existing commits, throw them on top of develop
git rebase develop

If you get an error messages, let me know (but that should be fine, I don't think there's been much activity in that specific part of the code!)

Assuming that went okay, though, now we rebase again, this time manipulating the commits:

git rebase -i develop...


That means "do an interactive rebase for commits on this branch, starting from where it diverges from develop onwards".

There are instructions when you run the command; you'll likely be using the "squash", "reword" or "fixup" commands.

(I believe it might be possible to just do that in one step, but I prefer splitting into two for manageability if there's conflicts)
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2013-11-01 01:43 pm (UTC)(link)

Crossing fingers and I wish you luck!

fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2013-11-05 03:00 am (UTC)(link)

Sorry, but I'm glad you recovered!