Git status - 不显示远程 Repo 的状态
Git status - Not showing states of remote Repo
刚从 Git 开始,我发现了一些奇怪的东西。
我在 github 上有一个 git 回购 - https://github.com/ankh2054/modx.git
我的服务器上有一个目录 /home/Modx
我已经将 github 添加为远程 Repo,如果我 运行 命令
git remote -v
我得到以下输出
origin https://github.com/ankh2054/modx.git (fetch)
origin https://github.com/ankh2054/modx.git (push)
但是当我 运行 git 状态时,它没有提到任何关于我的远程 Repo 的信息。因此,当我在本地更新和提交文件时,它不会提示我本地存储库比远程存储库更新。
git status
On branch master
nothing to commit, working directory clean
我应该说我相信的是:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
检查 git branch -avvv
的输出。
如果您没有看到任何远程分支,则意味着您需要:
git fetch
git branch -u origin/master
从那里您可以比较 master
和 origin/master
。
你将能够做一个简单的 git push
.
刚从 Git 开始,我发现了一些奇怪的东西。
我在 github 上有一个 git 回购 - https://github.com/ankh2054/modx.git 我的服务器上有一个目录 /home/Modx
我已经将 github 添加为远程 Repo,如果我 运行 命令
git remote -v
我得到以下输出
origin https://github.com/ankh2054/modx.git (fetch)
origin https://github.com/ankh2054/modx.git (push)
但是当我 运行 git 状态时,它没有提到任何关于我的远程 Repo 的信息。因此,当我在本地更新和提交文件时,它不会提示我本地存储库比远程存储库更新。
git status
On branch master
nothing to commit, working directory clean
我应该说我相信的是:
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
检查 git branch -avvv
的输出。
如果您没有看到任何远程分支,则意味着您需要:
git fetch
git branch -u origin/master
从那里您可以比较 master
和 origin/master
。
你将能够做一个简单的 git push
.