Git - Won't add files?

后端 未结 29 1989
小蘑菇
小蘑菇 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:39

    In such cases, please check for rules in global .gitignore file and make sure that your folder does not fit into those.

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

    I just had this issue and the problem was that I was inside a directory and not at the top level. Once I moved to the top level it worked.

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

    I have tried all the above but nothing was working. Later on, I ran my command prompt as an admin and retried all the stages i.e. staging-> committing-> remote add -> pushing. It worked like a magic. The changes were reflected in the desired remote repository.

    Hope it helps :) Keep calm and keep coding.

    P.S. I am new bee and try to learn from the mistake.

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

    Similar happened for me when I renamed a file between Uppercase/Lowercase. So, temporary file renaming might fix problem.

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

    Here is how I got mine to work:

    I started by

    git init 
    

    inside the directory with all the files/folders that I wanted to include.

    I ran

    git add --all
    git add .
    git commit -m "uploaded fixed sources 3"
    git push origin master
    

    THEN

    I made another directory outside of the origin, I moved into that directory, then I cloned the existing git repo using the http://../../.git file as set out on the page in github.

    Once it cloned the source (which had nothing more than a readme.md) I copied all the files from the old directory into the new one with

    cp -rf ../../* .
    

    Then I added again, and then commited and pushed those edits.

    git add --all
    git add .
    git commit -m "uploaded fixed sources 4"
    git push origin master
    

    Don't ask me why, but this time they uploaded into the github site and appeared as files you can access in the .zip tarball.

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