Git Cheatsheet

Commands I often forget


  1. Setting remote

    git remote set-url origin

  2. Stash specific file

    git stash -- filename1 [filename2..]

  3. Reset your branch from remote

    git fetch git reset --hard origin/master

  4. Renaming current branch

    git branch -m 'new_branch_name'

  5. Undoing the last commit

    git reset --soft HEAD~

  6. Setting config values

    git config user.name "Norly Canarias"

    git config user.email "canariasnorly@gmail.com"