Skip to content

Instantly share code, notes, and snippets.

@celine-m-s
Last active June 18, 2018 08:34
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 celine-m-s/bf2832e5c28ea76a39eeb867ae6bf84a to your computer and use it in GitHub Desktop.
Save celine-m-s/bf2832e5c28ea76a39eeb867ae6bf84a to your computer and use it in GitHub Desktop.
# Update files that are already in the index and commit.
# == git add . + git commit -m "A message"
git commit -a -m "Ajouté itinéraire dans checklist-vacances.md"
# Create a new commit to cancel another one.
git revert SHACommit
# Change last commit message.
git commit --amend -m "Votre nouveau message"
# Erase all changes done after the last commit.
git reset --hard
# Create a new branch and checkout.
git checkout -b mybranch
# List people who made changes on a repo.
git blame
# Returns for example: ^05b1233 (Céline MS 2014-08-08 00:31:02 1)
# Show details of a commit with a SHA beginning.
git show 05b1233
# Keep last uncommitted changes.
git stash
# Bring back the last stash and free it.
git stash pop
# Bring back the last stash but keep files.
git stash apply
# Delete a local branch
git branch -d mybranch
# Delete a remote branch
git push origin --delete mybranch
# Resolve merge conflicts
git mergetool --tool=vimdiff
# GITHUB
t => find in this repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment