Git - Won't add files?

后端 未结 29 1987
小蘑菇
小蘑菇 2020-12-13 12:01

I\'m having issues where I can\'t add files to my repository.

I\'m using GIT on windows, in Aptana Studio for some Ruby development.

I\'ve managed to push a

相关标签:
29条回答
  • 2020-12-13 12:14

    Best bet is to copy your folder. Delete the original. Clone the project from github, copy your new files into the new cloned folder, and then try again.

    0 讨论(0)
  • 2020-12-13 12:16

    I searched around for a while and ended up finding out I had blocked off the SSH port which was what caused the git add command to stop working. I ended up changing origin using https with the following command: git remote set-url origin [url-to-git-repo]

    0 讨论(0)
  • 2020-12-13 12:16

    I had a similar issue.

    The problem was, on Windows, in the index, the file was added in a case different from what was in the unstaged area. For example, in the index, the file was name xx.txt and in the unstaged area, the file was names Xx.txt.

    Removed the file with the incorrect case from the index (xx.txt). Then, I have been able to add the file with the correct case (Xx.txt).

    0 讨论(0)
  • 2020-12-13 12:17

    To add to the possible solutions for other users:

    Make sure you have not changed the case of the folder name in Windows:

    I had a similar problem where a folder called Setup controlled by Git and hosted on GitHub, all development was done on a Windows machine.

    At some point I changed the folder to setup (lower case S). From that point on when I added new files to the setup folder they were stored in the setup folder and not the Setup folder, but I guess because I was developing on a Windows machine the existing Setup folder in git/github was not changed to setup.

    The result was that I couldn't see all of the files in the setup in GitHub. I suspect that if I cloned the project on a *nix machine I would have seen two folders, Setup and setup.

    So make sure you have not changed the case of the containing folder on a Windows machine, if you have then I'd suggest:

    • Renaming the folder to something like setup-temp
    • git add -A
    • git commit -m "Whatever"
    • Rename the folder back to what you want
    • git add -A
    • git commit -m "Whatever"
    0 讨论(0)
  • 2020-12-13 12:17

    I had this problem with the first program in the folder. I did "git add" then "git commit". "git status" gave the error described i.e. "nothing to commit, working directory clean"

    I ended up deleting the .git file from the program folder. Then I did a new git init, git add and git commit and it worked.

    0 讨论(0)
  • 2020-12-13 12:17

    Another issue can be file permissions. Try issuing : chmod 755 file1

    0 讨论(0)
提交回复
热议问题