ubuntu - How done with git fetch, checkout and pull with one command line? -


every time run 3 commands when need test team member code on local.

like that:

git fetch remote_name branch_name  git checkout branch_name git pull origin master 

or

git fetch remote_name branch_name && git checkout branch_name etc...

because after fetch checkout need pull origin master. if can run 1 command done step faster.

does git has command fix that?

if use combination of commands often, might want add function shell, suggested @elpiekay. example, if use bash or dash, adding following code ~/.bashrc allow type foo remote_name branch_name equivalent statements in question.

function foo {     git fetch $1 $2 && git checkout $2 && git pull origin master } 

if rather type git foo remote_name branch_name, possible create multi-statement git aliases answered in this question.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -