Skip to content

Instantly share code, notes, and snippets.

@alexbonhomme
Last active February 3, 2017 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbonhomme/52cec1657b9ecc886e10 to your computer and use it in GitHub Desktop.
Save alexbonhomme/52cec1657b9ecc886e10 to your computer and use it in GitHub Desktop.
GIT tips

Déplacer les N derniers commits vers une NOUVELLE branche (ne fonctionne pas avec une branche déjà créée)

git branch newbranch
git reset --hard HEAD~N
git checkout newbranch

Renommer un tag local/distant

git tag new_tag old_tag
git push --tags

git push origin :refs/tags/old_tag
git tag -d old_tag

Supprimer un tag local/distant

git tag -d tag_name
git push origin :refs/tags/tag_name

Annuler un commit

git reset --hard HEAD@{1}

Eventuellement faire un git log -g pour revenir a un commit particulier (cf. http://stackoverflow.com/a/21778/5727772).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment