0

I am not very nuanced when it comes to GIT, despite my attempts in learning it, so pardon my asking what may be a simple question.

I have been developing an autodidactic program in Java (a secondary language to me), and using Git to store commits. I have also been pushing to a TFS server, which uses Git.

Now, apparently the repo has corrupted itself. I think it's a problem with Sharepoint Workspaces...but that's besides the point, as I now cannot commit my changes to either my local repository, nor to the upstream one.

Could someone kindly walk me through the steps to (hopefully) uncorrupt my repo, and allow me to commit again? Normally I'd just blow it away, and redownload the project...but I've made some changes to the code, and would like to know if I can somehow save those changes without resorting to some sort of a painful process (i.e. going file by file, and popping them in, or using a diff tool, etc.). Is there any way to just reinitialize the repo, then tell it to grap the local (uncommitted) files, and commit them?

Part of the fun is that this is in NetBeans, which has code guards, which makes modifying code a PITA.

4

1 回答 1

0

您需要提供更多详细信息:

  • 您使用哪些命令/操作来存储提交和拉/推?
  • 尝试在存储库中提交时收到什么消息错误?
  • 你之前的提交是在服务器上吗?
  • 你可以使用 git log 命令吗?

命令:git log origin/master..HEAD

可以显示您未推送的提交。您可以使用以下命令执行 diff 和带有修改的补丁以应用于新的 repo:

git diff origin/master..HEAD >> modifications_not_pushed.diff
于 2013-06-09T02:19:03.570 回答