GIT: How to take a single commit from one branch and apply it to another.
#git clone firstname.lastname@example.org:/yourproject.git -b Develop develop_folder
Now we fix the files and push changes to the HEAD of our branch
#git pull #git commit -m "Fixing issue #7" #git push origin master
Now we have to get the SHA1 code for the specific commit.
#git log -1 --pretty=oneline b5d39bcb8658f287ea6d6c5b239f4ba514239831 Fixing issue #7
2. Put the commit to our Release Branch
Now we need to checkout our release branch in a new folder
#git clone email@example.com:/yourproject.git -b Release release_folder
Now we need to execute the command to bring the commit from our Develop branch to our Release branch using the SHA1 code
#git cherry-pick b17f5b936b34ef9f827cb48ed348797f967ba258
Here's what that command does:
- Look at that commit on the feature branch
- See what changes it introduced
- Create a new commit on the master branch that introduces the same changes.
At the end we only need to push our changes to the HEAD of our Release branch.