Skip to content

Instantly share code, notes, and snippets.

@adenosinew
Last active February 20, 2024 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adenosinew/af326d8b4212c0caf15d2d7c938cbb01 to your computer and use it in GitHub Desktop.
Save adenosinew/af326d8b4212c0caf15d2d7c938cbb01 to your computer and use it in GitHub Desktop.
[Git commands]
# https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
git for-each-ref --sort=-committerdate refs/heads/
# Or using git branch (since version 2.7.0)
git branch --sort=-committerdate # DESC
git branch --sort=committerdate # ASC
#Tell git which ssh key to use
#Configuration core.sshCommand:
#From Git version 2.10.0, you can configure this per repo or globally,
git config core.sshCommand "ssh -i ~/.ssh/id_rsa_example -F /dev/null"
git pull
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment