GitHub同步此分支失败



我收到同步失败的错误消息。我四处寻找解决方案,发现git status会给出一些关于这个问题的想法。所以我这么做了,得到了这个:

    # On branch dev_0.9_HUD_development
# Your branch is behind 'origin/dev_0.9_HUD_development' by 1 commit, and can be
 fast-forwarded.
#   (use "git pull" to update your local branch)
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   res/models/hud/HUD2.png
#       modified:   src/Weapon/Laser.java
#       modified:   src/Weapon/Weapon.java
#       modified:   src/game/world/gui/hud/HeadsUpDisplay.java
#       modified:   src/game/world/gui/hud/ShipStat.java
#       modified:   src/game/world/gui/hud/WeaponDisplay.java
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       src/hero101.mtl
#       src/hero101.obj

有许多解决办法,但似乎没有一个奏效。我试着重新启动电脑。什么也没有发生。我尝试git checkout,但它给出了另一个错误。我尝试合并分支仍然得到相同的错误。我能做些什么来解决这个问题?

如果你的分支在上游远程分支之后,那意味着你还没有做任何提交。

命令行:

cd /patH/to/your/repo
git stash
git pull
git stash pop
git add -A
git commit -m "My work"
git push

假设当前git状态下列出的所有文件都是你想要版本的修改文件

好的。所以我查看了repo中的。git文件夹。我改了索引的名字。之后,我做了git stash和git pull,一切都工作了。

最新更新