'git add。'不起作用 [英] 'git add .' doesn't work
问题描述
我目前正在尝试为我一直在研究的项目设置Git。我确实记得在不久之前设置Git,但从未因各种原因而使用它。现在我想使用它,我遇到了一个奇怪的问题,我认为它与旧的安装有关。
要开始全新安装新的Ubuntu操作系统,以便在那里将没有Git安装目前,我复制了项目(Grails)。然后,我导航到该目录并运行以下命令:
git init
git remote add origin https://USERNAME@bitbucket.org/USERNAME/APPNAME.git
然后我跑了:
git add。
这是我得到以下错误的地方:
fatal:不是git存储库:/home/user/workspace/App_V3/.git/modules/plugins/grails-spring-security-ui
$ c
这个错误很奇怪,因为这个目录甚至与我目录下的目录不匹配。
/ home / user / Workspace / App_V7 /
我以为最初我可能会设置Git在旧操作系统的App_V3文件夹中,但不知道它为什么仍然指向该目录,因为我已经运行了下面的代码来重新初始化它:
rm -rf .git
git init
有人可以请帮助我,因为它真的令人沮丧:S
预先感谢
解决方案我将所有文件一次移动到一个新文件夹,然后似乎正常工作:)
感谢您的帮助
I am currently trying to setup Git for a project I have been working on for a while. I do remember quite a while ago setting up Git but never used it for various reasons. Now I want to use it i am getting a strange issue that I believe is related to an old install.
To start a fresh I installed a fresh Ubuntu OS so that there would be no Git install present and I copied the project (Grails) over. I then navigated to the directory and run the following commands:
git init
git remote add origin https://USERNAME@bitbucket.org/USERNAME/APPNAME.git
Then I ran:
git add .
This is where i get the error below:
fatal: Not a git repository: /home/user/workspace/App_V3/.git/modules/plugins/grails-spring-security-ui
This error is weird as this doesn't even match the directory I am in as the directory is below:
/home/user/Workspace/App_V7/
I am thinking that originally I may have setup the Git in the App_V3 folder on the old OS but don't know why it still points to that directory as I have run the code below to re-initialize it:
rm -rf .git
git init
Can someone please help me with this as its really frustrating :S
Thanks in advance
解决方案 I moved all of the files one at a time to a new folder and then seemed to work fine :)
Thanks for the help
这篇关于'git add。'不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!