我显然不擅长使用git,尽管我尽了最大努力去理解它。
来自kernel.org的git推送:
- u ——set-upstream 对于每个最新的或成功推送的分支,添加upstream(跟踪)引用,由无参数的git-pull(1)和其他命令使用。更多信息请参见branch.<name>。在git-config(1)中合并。
这是分支。<名称>。从git配置中合并:
branch.<name>.merge Defines, together with branch.<name>.remote, the upstream branch for the given branch. It tells git fetch/git pull which branch to merge and can also affect git push (see push.default). When in branch <name>, it tells git fetch the default refspec to be marked for merging in FETCH_HEAD. The value is handled like the remote part of a refspec, and must match a ref which is fetched from the remote given by "branch.<name>.remote". The merge information is used by git pull (which at first calls git fetch) to lookup the default branch for merging. Without this option, git pull defaults to merge the first refspec fetched. Specify multiple values to get an octopus merge. If you wish to setup git pull so that it merges into <name> from another branch in the local repository, you can point branch.<name>.merge to the desired branch, and use the special setting . (a period) for branch.<name>.remote.
我成功地用github建立了一个远程存储库,我成功地将我的第一次提交到它:
git push -u origin master
然后,我无意中成功地将我的第二次提交推到我的远程存储库,使用:
git commit -m '[...]'
然而,我错误地认为我必须再次从master推到原点,我运行:
# note: no -u
git push origin master
这有什么用?这似乎根本没有任何效果。我“撤销”git push -u origin master了吗?