简体   繁体   中英

Git pull changes for active branch

Question is simple how can I pull changes for my active branch without using full command git pull origin <branch_name> there must be shortcut for this command, is there?

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

Thanks

UPDATE

Based on bellow accepted answer this is output which explains more

>git remote show origin
* remote origin
  Fetch URL: git@github.com:XXX/FooBar.git
  Push  URL: git@github.com: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)

git push --set-upstream origin feature_x将允许git pull成为git pull origin feature_x的简写

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM