-
-
Save marcoow/622464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# which branch does contain the given commit | |
git branch --contains d590f2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given some SHAs from commits, create a hotfix for this | |
# 0. Make sure you are working on a clean working copy | |
git status | |
# 1. Find the commits | |
# 2. Determine which branch they are on | |
git branch --contains COMMIT_SHA | |
# 3. Create branch from production (XXXX == ticket number) | |
git checkout production | |
git checkout -b hotfix/XXXX | |
# 4. Cherry-pick the changes | |
git cherry-pick COMMIT_SHA | |
# 5. if necessary resolve merge conflices | |
# 6. push hotfix | |
git push origin hotfix/XXXX | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# branch to delete == hotfix/2534 | |
# 0. make sure this is fully merged | |
git checkout develop | |
git pull | |
git merge hotfix/2534 | |
# => should be already up to date, maybe also do it in production/corporate-production | |
# 1. delete local branch | |
git branch -d hotfix/2534 | |
# 2. delete remote local branch (copy of remote in local repository), assuming remote is named origin | |
git branch -r -d origin/hotfix/2534 | |
# 3. delete branch on remote | |
git push origin :hotfix/2534 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /var/git/repositories -name '*.git' | xargs -I % sh -c "cd %; sudo -u git git gc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all missing commits from production but in list | |
# needs to be reviewed if this is really doing what is advertised | |
git show-branch --topic --sha1 production list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment