Skip to content

Instantly share code, notes, and snippets.

@psachin
Last active June 3, 2018 08:43
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 psachin/2c441d199bd2e7c015441238c8fe1c8b to your computer and use it in GitHub Desktop.
Save psachin/2c441d199bd2e7c015441238c8fe1c8b to your computer and use it in GitHub Desktop.
Recent git commands
  • Show changes in stash

    git stash show -p stash@{0}
    
  • Save stash with message

    git stash save "MESSAGE"
    
  • Authetication GitHub using 2FA(two-factor authentication)

    • create a file ~/.git-credentials with following content
      https://<GITHUB_USERNAME:GITHUB_TOKEN>@github.com
      
    • Store token
      git config --global credential.helper store
      

    Where GITHUB_TOKEN can be generated by visiting https://github.com/settings/tokens

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