2012-08-23 97 views
0

問題很簡單如何在不使用完整命令的情況下爲我的活動分支拉動更改git pull origin <branch_name>此命令必須有快捷方式,是嗎?Git pull對活動分支的更改

git checkout -b feature_x 
git push origin feature_x 
git pull origin feature_x # is there shortcut, keeping in mind this is active branch 

感謝

更新基於波紋管接受的答案

這是說明更

>git remote show origin 
* remote origin 
    Fetch URL: [email protected]:XXX/FooBar.git 
    Push URL: [email protected]:XXX/FooBar.git 
    HEAD branch: master 
    Remote branches: 
    master  tracked 
    feature_x tracked 
    Local branches configured for 'git pull': 
    master  merges with remote master 
    feature_x merges with remote feature_x  
    Local refs configured for 'git push': 
    master  pushes to master  (up to date) 
    feature_x pushes to feature_x (up to date) 
+0

它只是在做'git pull'嗎? – johusman

+0

廣告上寫着「您要求我在不告訴我要合併哪個分支的情況下拉動......請指定您要在命令行上使用哪個分支並再試一次」 –

回答

2

git push --set-upstream origin feature_x將使只是git pull成爲git pull origin feature_x

速記輸出
+0

當我刪除分支時,它切換回主? –

+0

你不能刪除你正在的分支,所以不能。 – jeremiahd

+1

@Dolphin首先,你現在必須在那個分支feature_x上。 – weynhamz