December 16, 2021

git alias to pull another branch and checkout it

 Open .gitconfig (usually it is in c:/users/YOUR-USER/.gitconfig) and add an alias:

[alias]
cb = !git fetch origin $1:$1 && git checkout

Then instead of doing

> git checkout master
> git pull

You can do 

> git cb master

And avoid double changes that cause reload in IDE.


No comments:

Post a Comment