【发布时间】:2011-12-18 05:06:51
【问题描述】:
我有一个如下目录:
/var/tmp/main
.. plugin1
.... mysource.c
.. plugin2
.... mysource.c
.. plugin3
.... mysource.c
我创建了一个存储库。之后,我应用了以下内容:
$ cd /var/tmp/main
$ git init
$ echo "hello git plz work" >> README
$ git add README
$ git commit -m 'first commit works'
$ git remote add origin git@...../main.git
$ git push origin master
我也试过
$ git add .
$ git status
# On branch master
# 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: folder1 (modified content)
# modified: folder2 (modified content)
# modified: folder3 (modified content)
# modified: folder4 (modified content)
# modified: folder5 (modified content)
# modified: folder6 (modified content, untracked content)
# modified: folder7 (modified content)
# modified: library (modified content, untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git commit -m 'Suggested by Stack experts'
$ git push
也试过 .gitignore
$ cat .gitignore
*.[oa]
*.pyc
*.gcda
*.gcno
*.la
*.lo
*.loT
*.sw[po]
*.tar.*
*~
.deps
.libs
ABOUT-NLS
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache
autoregen.sh
compile
config.guess
config.h
config.h.in
config.log
config.rpath
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
到现在都一样……
一切就绪,但 14 小时后我仍然看不到 Git 中的所有目录,我只看到 README 文件显示。
我怎样才能全部提交? (关注http://scottr.org/presentations/git-in-5-minutes/)
【问题讨论】:
-
添加 all 内容,而不是单个文件。 “......添加。”,AFAIR
-
我这样做没用: git add .
-
@LazyBadger:请参阅上面的更新。
-
@Google 很确定您的问题是:
git commit -m 'Suggested by Stack experts'应该是git commit -am 'Suggested by Stack experts'(注意添加的 -a 参数)。事实上,您最好删除 -m "Some commit message" 内联提交消息参数并仅使用git commit -a直到您更熟悉该过程。
标签: version-control c git linux github