Skip to content

Instantly share code, notes, and snippets.

@simone-sanfratello
Last active March 2, 2024 08:24
Show Gist options
  • Save simone-sanfratello/07aadfe8d8c3eb6acce1f8a6cfde699f to your computer and use it in GitHub Desktop.
Save simone-sanfratello/07aadfe8d8c3eb6acce1f8a6cfde699f to your computer and use it in GitHub Desktop.
Tips & Tricks collection

Tips & Tricks collection

Command aliases

git

  • add origin named "upstream" to the forked repo
git remote add upstream https://github.com/OWNER/REPOSITORY.git
  • push the current branch, which is new
alias git-push-new-branch='git push --set-upstream origin $(git branch --show-current)'
  • sync forked repo from origin
git fetch origin && git checkout main && git merge upstream/main
  • clone a repo using a specific auth key
git clone [email protected]:OWNER/REPOSITORY.git --config core.sshCommand="ssh -i ~/.ssh/that-key"

docker

  • stop all running containers
alias docker-stop-all='docker stop $(docker ps -q)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment