1

我是 github 菜鸟,但由于开源方面的原因,我想使用它。

我设法按照教程,最初填充存储库并从我的 eclipse android 工作区上传文件。现在我添加了更多文件并在我的 ubuntu 终端中尝试了以下 git 命令。

cd Dropbox/android/workspace
git add .    //figured this would add the new files?
git commit -m 'changed a few things...'
git push origin master

任何地方都没有错误消息,当我查看 github 网站时,我看到了一个 .metadata 文件夹,其中包含我在上面输入的提交消息。其他文件夹没有此消息。我寻找我的新文件,但它们不在 github 上。

我错过了一些非常容易的事情吗?

这是终端输出:

git add -A

没有。

git commit -m 'blah'

[master 41642e3] new fiels
 16 files changed, 57 insertions(+)
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/.markers.snap
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/.syncinfo.snap
 delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/Finance_Calculator2/org.eclipse.jdt.core/state.dat
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/.markers.snap
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/.syncinfo.snap
 delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/MyCalcFinance2/org.eclipse.jdt.core/state.dat
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/.markers.snap
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/.syncinfo.snap
 delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/TabletCalc/org.eclipse.jdt.core/state.dat
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/.markers.snap
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/.syncinfo.snap
 delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.projects/blank/org.eclipse.jdt.core/state.dat
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap
 create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.snap
 create mode 100644 .metadata/.plugins/org.eclipse.team.cvs.core/.running

git push origin master

To https://github.com/killerpixler/Android-Application-Development.git
   bb1d6a5..41642e3  master -> master
4

2 回答 2

1

尝试git add -A而不是git add .. 由于您的代码位于当前目录下的目录中,我假设 git add 。只添加当前目录中的目录,但它不是递归的,不会添加这些目录下的文件。 git add -A将添加所有更改的文件。-A您可以通过创建一个.gitignore明确说明不添加的文件(即/bin/gen目录)的文件来排除某些文件的添加选项。

于 2012-06-15T15:38:57.650 回答
0

如果它是您正在谈论的空文件夹 - 这是正常的行为。默认不会添加空文件夹。您可以按照以下步骤强制它这样做:

在空目录中创建一个名为的文件.gitignore,其中包含以下两行:

# Ignore everything in this directory
*
# Except this file
!.gitignore
于 2012-06-15T15:48:39.223 回答