[gambit-list] More Git tips

Lassi Kortela lassi at lassi.io
Mon Nov 11 13:29:48 EST 2019


One thing I use all the time is having multiple Git remotes in a single 
local Git clone. You can list them:

$ git remote -v
gambit	git at github.com:gambit/gambit.git (fetch)
gambit	git at github.com:gambit/gambit.git (push)
lassik	git at github.com:lassik/gambit.git (fetch)
lassik	git at github.com:lassik/gambit.git (push)
udem-dlteam	git at github.com:udem-dlteam/gambit.git (fetch)
udem-dlteam	git at github.com:udem-dlteam/gambit.git (push)

and add new ones with `git remote add`. Usually you'd have the `origin` 
remote be the one where you normally push new topic branches, and 
`upstream` be the official repo where they are integrated. But the names 
are for your local convenience and don't affect any public activity.

Having only one clone of each repo is easier to keep track of than 
multiple clones. And it's easy to diff and move branches between clones. 
`git fetch --all --tags` fetches the changes from all remotes at once 
(without touching any of your local branches) so it's easy to stay up to 
date with multiple remote repos.

For Emacs, Magit (https://melpa.org/#/magit) is extremely useful. It 
provides single-letter commands, syntax coloring and other convenience 
for most Git functions. It's quite hard to learn but saves tons of time 
on a daily basis.




More information about the Gambit-list mailing list