git pull没有看到最近的变化

时间:2015-09-04 10:44:08

标签: git git-pull

我正在尝试使用git从远程存储库中提取最近的提交,但它没有看到更改。这是我尝试提取的本地服务器的输出:

[root@app-dev ansible]# git pull
Already up-to-date.

[root@app-dev ansible]# git log --pretty=oneline
96f7b87b2a433cf2182909b0e8238378169112a9 Fixed Plesk init_conf issues
2c4145615af4f24f265eadfa729a4b5a84d01afd Initial commit

[root@app-dev ansible]# git status
# On branch master
nothing to commit (working directory clean)

[root@app-dev ansible]# git remote show origin
* remote origin
  Fetch URL: http://dev.domain.com/ansible/.git
  Push  URL: http://dev.domain.com/ansible/.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

在远程存储库中:

[root@www ansible]# git log --pretty=oneline
9aef656c5800cb4f5d46270934899994eabe1580 Added readme file - TEST
96f7b87b2a433cf2182909b0e8238378169112a9 Fixed Plesk init_conf issues
2c4145615af4f24f265eadfa729a4b5a84d01afd Initial commit

因此,远程存储库还有一个提交,当地人在运行git pull时没有看到。

更新

在本地存储库上运行git fetch --force && git reset --hard origin/master会返回此信息(仍然不是最近的提交):

[root@app-dev ansible]# git fetch --force && git reset --hard origin/master
HEAD is now at 96f7b87 Fixed Plesk init_conf issues

在远程仓库上运行git status

[root@www ansible]# git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       playbook.zip
nothing added to commit but untracked files present (use "git add" to track)

我做错了什么,如何让本地从远程仓库中取出最新版本?

0 个答案:

没有答案