Last active
December 9, 2019 10:03
-
-
Save azborgonovo/24a0009e7639be4b5b6e to your computer and use it in GitHub Desktop.
Git commands.
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
git remote add github https://github.com/Company_Name/repository_name.git | |
git push github master |
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
1. Rename your local branch. | |
If you are on the branch you want to rename: | |
git branch -m new-name | |
If you are on a different branch: | |
git branch -m old-name new-name | |
2. Delete the old-name remote branch and push the new-name local branch. | |
git push origin :old-name new-name | |
3. Reset the upstream branch for the new-name local branch. Switch to the branch and then: | |
git push origin -u new-name |
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
// -------------------------------------------------------------- | |
// CHERRY PICKING EDITING MESSAGE AND SETTING STRATEGY OPTION | |
// -------------------------------------------------------------- | |
git cherry-pick 5c171162 --edit --strategy-option=theirs |
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
// ---------------------------------------- | |
// CREATE A GIT TAG | |
// ---------------------------------------- | |
git tag -a v1.4 -m "my version 1.4" | |
git show v1.4 | |
git push origin v1.4 | |
// ---------------------------------------- | |
// DELETE A GIT TAG | |
// ---------------------------------------- | |
git tag -d v1.4 | |
git push origin :refs/tags/v1.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment