1

I'm a github noob but I'd like to use it because of the open source aspect.

I managed to follow the tutorial, fill a repository initially and upload the files from my eclipse android workspace. Now I have added a few more files and tried the following git commands in my ubuntu terminal.

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

No error messages anywhere and when I look onto the github website, I saw a folder .metadata with the commit message I entered above. The other folders didn't have this message. I looked for my new files but they were not on github.

Am I missing something terribly easy?

Here is the terminal output for:

git add -A

Nothing.

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
Chris Knadler
  • 2,819
  • 2
  • 26
  • 32
Killerpixler
  • 4,200
  • 11
  • 42
  • 82
  • Putting your Git repository in a Dropbox directory is generally a bad idea; Dropbox can corrupt the repository. –  Jun 15 '12 at 15:41

2 Answers2

1

try git add -A instead of git add .. Since your code is located in directories under the current directory, I'd assume git add . only adds the directories in the current directory, but it's not recursive and does not add the files below these directories. git add -A will add all the changed files. You can exclude some files from being add with the -A option by creating a .gitignore file that explicitly says what's not to be added (i.e the /bin and /gen directories).

asenovm
  • 6,397
  • 2
  • 41
  • 52
  • I did, again no errors but it still doesnt work. (i did the add, commit, push) – Killerpixler Jun 15 '12 at 15:47
  • can you post what's print in the terminal when invoking `add,commit,push` – asenovm Jun 15 '12 at 15:50
  • That's incorrect. `git add .` is recursive. And `git add -A` is short for `git add .; git add -u`. Read http://stackoverflow.com/questions/572549/difference-of-git-add-a-and-git-add – Jagtesh Chadha Jun 15 '12 at 15:56
  • got it to work... turns out that eclipse was stupid and put that project into a different folder that wasnt in the repo... therefore git didnt have anything new to push :) thanks thou – Killerpixler Jun 15 '12 at 16:28
0

If it's an empty folder you're talking about - this is normal behavior. by default, will not add empty folders. You could force it to do so by following these steps:

Create a file named .gitignore inside the empty directory, with the following two lines:

# Ignore everything in this directory
*
# Except this file
!.gitignore
Jagtesh Chadha
  • 2,632
  • 2
  • 23
  • 30
  • it is not. I created new .java files in my android project and want to push them to github – Killerpixler Jun 15 '12 at 15:59
  • Try adding the files explicitly: `git add DIR/*.java` then checking the status with `git status`. If you get "nothing to commit" as response, check the log `git log DIR/FILE.java`. It will only say "nothing to commit" if this file is already committed. – Jagtesh Chadha Jun 15 '12 at 16:04
  • Do check what branch you're currently using: `git branch`. It should display `* master` which means, the starred branch (master) is currently enabled - as should be the case. – Jagtesh Chadha Jun 15 '12 at 16:06