-u标志在git push -u origin master中意味着什么? [英] What does the -u flag mean in git push -u origin master?

查看:292
本文介绍了-u标志在git push -u origin master中意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道-u标志在此命令中是什么意思?

I was just wondering what does the -u flag mean in this command?

git push -u origin master

推荐答案

-u 选项执行以下操作: 对于每个最新的或成功推送的分支,请添加上游(跟踪)引用,该引用由无参数的git-pull和其他命令使用.

The -u option does the following: For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull and other commands.

因此,在使用 -u 选项推送本地分支之后,该本地分支将自动与远程分支链接,并且您可以使用不带任何参数的git pull.

So, after pushing your local branch with -u option, this local branch will be automatically linked with remote branch, and you can use git pull without any arguments.

这篇关于-u标志在git push -u origin master中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆