9/30/2017 - 2:16 AM


Gotta git gud, ya know?


Change a remote

Base recipe:

  • git remote set-url <remote> <url>

HTTPS to SSH (GitHub):

  • git remote set-url <remote><username>/<repository>.git

SSH to HTTPS (GitHub):

  • git remote set-url <remote><username>/<repository>.git

Apply .gitignore changes

First commit any code changes, then run: git rm -r --cached . and then re-add: git add ..

To undo: git rm --cached filename then git add filename

Convert EOL to LF

  1. Clean working directory.
  2. Set end_of_line = lf in .editorconfig.
  3. Create .gitattributes file containing * text=auto eol=lf.
  4. Commit.
  5. Run git add --renormalize .
  6. Commit.