【发布时间】:2014-08-16 06:19:44
【问题描述】:
我从备份 tarball 中收到了修改后的旧版本 ERPNext 的代码,我想将此代码添加到我的 Ubuntu 笔记本电脑上的本地 Git 存储库中,以便我可以跟踪更改,直到我的雇主可以托管远程存储库。假设备份已经在~/backup/erpnext/ 中提取,我正在尝试设置我的 Git 存储库以进行如下初始提交:
cd ~
mkdir erpnext
cd erpnext
cp -r ~/backup/erpnext/* ./
git init
git add *
我认为,这应该将备份中的所有文件和文件夹添加到~/erpnext 目录,并将它们全部暂存以进行初始提交。但是,为了确保一切按预期工作,我在提交之前运行了git status,并收到了以下输出:
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: app
new file: conf.py
new file: conf.pyc
new file: erpnext-backup.log
new file: erpnext-sch.log
new file: lib
new file: public/app
new file: public/app.html
new file: public/css/all-app.css
new file: public/css/all-web.css
new file: public/js/all-app.min.js
new file: public/js/all-web.min.js
new file: public/js/editor.min.js
new file: public/js/slickgrid.min.js
new file: public/lib
new file: scheduler.lock
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: app (modified content, untracked content)
modified: lib (modified content, untracked content)
让我吃惊的是app 和lib(它们都是文件夹)被标记为具有修改的内容,并且没有准备提交。我尝试在*、app 和lib 上运行git add --force,但它似乎没有任何改变。
我不想提交我的代码并将这些文件夹从存储库中排除。我该如何解决这个问题?
【问题讨论】:
-
app和lib是文件夹还是子模块? -
app/文件夹和lib/文件夹是否有可能包含.git/目录? -
@EdwardThomson 他们应该只是文件夹,AFAIK。这是一个独立的项目,所以我不希望其中有任何submodules。
-
@umläute 现在我在文件管理器中查看它,是的,
.git/目录和.gitignore都存在。这些应该被删除吗?