2012-06-26 27 views

回答

2

請注意,您可以設置my_testing_branch

的上游分支
git branch --set-upstream my_testing_branch someone/someone_branch 

(這裏使用遠程名爲「有人」)

,簡單的git拉就可以了(但仍然需要:git checkout my_testing_branch + git pull

要回答你的問題,一種方法是定義git alias

git config --global alias.fetch-github '"!f() { git fetch [email protected]:$1/$2.git $3 ; git checkout FETCH_HEAD -b $4 }; f"' 

你會使用它,像這樣:

git fetch-github someone repo someone_branch my_testing_branch 
相關問題