Our team works on a legacy application and is relatively small and new to using GIT repositories to control our source code. We don't have a Git Master, and we really don't have any way of keeping our changes organized.
As a result, we've pushed some changes to our Master branch after making a successful release - only to find that release now needs a hot fix.
We don't want to push the changes we're working on for the next release - so ideally we want to:
This is our first time trying to make a live fix to the code - I've seen some suggestions but most of them involve basing it off of a developer branch that hasn't already been pushed. What can we do, as a group that has already pushed changes out to Master and want to apply a fix to an old push?
What you describe is basically correct.
abc123f
. It could also be a tag which works the same ad a commit (commit, branch, tag - all are refs. A branch is a moving target, but commit and tag ate immutable).git checkout abc123f
git checkout master; git fetch --all; git pull
to get the up to date mastergit merge hotfix-branch
followed by git push
will add and push the hotfix into master upstream. Remember you can always use git diff
to compare branches to check your work and verify. I do this very often and you should too, as having confidence in your changes is a primary benefit if version control!
8