刚开始使用Git,我发现了一些奇怪的东西。
我在github上有一个git repo - 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 status时,它没有提到我的远程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
答案 0 :(得分:5)
检查git branch -avvv
的输出。
如果您没有看到任何远程分支,则表示您需要:
git fetch
git branch -u origin/master
从那里,您将对master
和origin/master
进行比较
而且你将能够做一个简单的git push
。