修复未完成的git pull

时间:2014-02-19 20:35:07

标签: git pull

由于权限错误,远程生产服务器上的Git pull过早停止:

lucy@brambor src $ git pull
...
Updating 45e2051..80f6f43
error: unable to create file src/templates/s/logo.eps (Permission denied)

现在应该修复权限,但是repo被破坏了,我该怎么办?我是git的新手,现在不要犯错误至关重要,这就是我在这里问的原因。

lucy@brambor src $ git status
# On branch master
# Your branch is behind 'origin/master' by 3 commits, and can be fast-forwarded.
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   templates/base.html
#   deleted:    templates/howto.html

...

#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   templates/management.html
#   templates/recaptcha.html

...

no changes added to commit (use "git add" and/or "git commit -a")

1 个答案:

答案 0 :(得分:0)

如果您已修复权限问题:

git clean -d
git reset --hard
git merge --ff-only origin/master