3
我改变了我的git仓库中一些目录的情况。 然后我推他们,注意到没有更新的情况。git在mac osx上:如何将文件名个案推送到原点?
后来我发现这样一个问题: git mv and only change case of directory
我按照建议使用:
git add -A
git commit --amend -m 'updated cases'
git push origin
但不是成功的git的服务器返回:
To [email protected]:kyogron/example.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:kyogron/example.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
能有什么我现在要做的是更新案例,而不会在我的git repo中破坏更多?
问候,
博德
PS:为了避免在未来的这个问题,你可以使用:
git config core.ignorecase false
喜小写的名字,谢谢你这有助于。不幸的是,我在github上的回购目录中现在有两个不同的目录。一个带有大写字母,另一个带有小写字母,它们保存相同的文件。如何删除这一个或更好地安全并用当地状态替换当前所有文件? – bodokaiser
@kyogron如果你用'git mv'(http://stackoverflow.com/a/3889000/6309)修复你的本地回购目录,将目录'A'重命名为目录'a',将不会有两个目录,并强行推动它。让它在本地看起来不错,然后强制推送:你会在GitHub上看到相同的提交。 – VonC
所以我遵循你的建议,并尝试使用git mv。 Git mv返回没有应用程序。即使github显示我有应用程序和应用程序。所以我决定在应用程序上尝试使用git rm -r,这也会删除应用程序......但是我重置回旧的状态以便manuelly重建我的存储库并使用--force将其推送。结果就是再次出现这两个目录应用程序和应用程序..... – bodokaiser