Skip to content

Instantly share code, notes, and snippets.

@mccarlosen
Last active November 25, 2021 16:45
Show Gist options
  • Save mccarlosen/99e46b132cf8e6cc972797ebe726f351 to your computer and use it in GitHub Desktop.
Save mccarlosen/99e46b132cf8e6cc972797ebe726f351 to your computer and use it in GitHub Desktop.
Git Snippets
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Delete and recreate the tag locally
git tag -d {tagname}
git tag {tagname}
3) Delete and recreate the tag remotely
git push origin :{tagname} // deletes original remote tag
git push origin {tagname} // creates new remote tag
4) Update local repository with the updated tag (suggestion by @wyattis)
git fetch --tags
5) Clear cache
git rm -r --cached .
git add .
git commit -m "Untracked files issue resolved to fix .gitignore"
6) Test pull request
git fetch origin pull/ID/head && git checkout FETCH_HEAD
git checkout -b BRANCHNAME
git checkout master
git merge BRANCHNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment