Git tips and tricks
Cloning a repo
While cloning a repo, clone with the SSH url. Do not use the http url. For example,
✅ good
$ git clone git@github.com:mindwaveventures/mw-handbook.git
❌ bad
$ git clone https://github.com/mindwaveventures/mw-handbook
After doing a proper clone, the remotes
in your local clone should look like
$ git remote -v
origin git@github.com:mindwaveventures/mw-handbook.git (fetch)
origin git@github.com:mindwaveventures/mw-handbook.git (push)
Updating a remote
Let's say we accidently cloned with http. To update the remote url, run
$ git remote remove origin
$ git remote add origin git@github.com:mindwaveventures/mw-handbook.git
Replace with the corresponding github ssh url.
Superb git tools
The git integration in vscode is brilliant, but there are a few CLI tools worth trying out.