我正在为一个开源项目做贡献。我有一个分支,我已经把它推到了我的GitHub存储库中,我可以在那里看到它(https://github.com/sedulam/CASSANDRA-13990)。我直接从项目源存储库中提取。
但是,当我执行git remote show origin时,它显示为陈旧:
laptop@pandaria:~/git/cassandra$ git remote show origin
* remote origin
Fetch URL: https://gitbox.apache.org/repos/asf/cassandra.git
Push URL: https://github.com/sedulam/CASSANDRA-13990.git
HEAD branch: trunk
Remote branches:
cassandra-1.0 tracked
cassandra-1.1 tracked
cassandra-1.2 tracked
cassandra-2.0 tracked
cassandra-2.1 tracked
cassandra-2.2 tracked
cassandra-3.0 tracked
cassandra-3.11 tracked
refs/remotes/origin/13990-trunk stale (use 'git remote prune' to remove)
trunk tracked
Local branches configured for 'git pull':
13990-trunk merges with remote 13990-trunk
trunk merges with remote trunk
Local ref configured for 'git push':
trunk pushes to trunk (local out of date)
laptop@pandaria:~/git/cassandra$ git push
Everything up-to-date
laptop@pandaria:~/git/cassandra$ git status
On branch 13990-trunk
Your branch is up-to-date with 'origin/13990-trunk'.
nothing to commit, working tree clean如何将本地13990中继连接到我在GitHub上的分支?
发布于 2019-07-22 18:47:55
在您的例子中,origin指的是gitbox.apache.org,而不是github.com。
请将github.com添加为远程设备:
git remote add github https://github.com/sedulam/CASSANDRA-13990.git并获取(git fetch github),以获得/refs/remotes/github/13990-trunk。
然后您可以创建一个本地分支跟踪远程分支。
git checkout --track -b 13990-trunk github/13990-trunkhttps://stackoverflow.com/questions/57151817
复制相似问题