Skip to content

Instantly share code, notes, and snippets.

@danilostrazzullo
Last active September 15, 2017 12:05
Show Gist options
  • Save danilostrazzullo/790e0b7a3034406ab03f849ea14949a3 to your computer and use it in GitHub Desktop.
Save danilostrazzullo/790e0b7a3034406ab03f849ea14949a3 to your computer and use it in GitHub Desktop.
I can't memorize these Git commands

Changing a remote's URL

git remote set-url origin NEW_REMOTE_URL

Clone single branch from repo

git clone -b BRANCH_NAME --single-branch REPO_URL

Untrack files (but don't delete them)

git rm --cached <file>

Squash local latests commits into one (DON'T DO IT for already shared commits)

git rebase -i HEAD~3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment