Skip to content

Instantly share code, notes, and snippets.

@azborgonovo
Last active December 9, 2019 10:03
Show Gist options
  • Save azborgonovo/24a0009e7639be4b5b6e to your computer and use it in GitHub Desktop.
Save azborgonovo/24a0009e7639be4b5b6e to your computer and use it in GitHub Desktop.
Git commands.
git remote add github https://github.com/Company_Name/repository_name.git
git push github master
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
// --------------------------------------------------------------
// CHERRY PICKING EDITING MESSAGE AND SETTING STRATEGY OPTION
// --------------------------------------------------------------
git cherry-pick 5c171162 --edit --strategy-option=theirs
// ----------------------------------------
// 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