0

Yes i'm new in git, but as far as i can see it's a pain.

Assuming that:

  • I'm working on Windows 7 64 bit
  • Git perfectly installed
  • Using an Assembla repo which i'm currently using with Eclipse and SVN
  • I'm now developing with the absolute latest version of Android Studio (updated just 2 days ago...)

I want to ask here, if is my lack of expertise, or it's simply inferior to SVN (which also gives me a bunch of problems in Android Studio, when in Eclipse i can work like a charm!).

This is what i've done: - made a project and decide to add to Version Control - went in project dir and get Bash console. - "git init" and there aren't all the files under git control because of this ignore list (why and how git decides alone that there are things to ignore here, is a mistery, if someone could explain that would be awesome.) - Deleted ".ignoregit" file list and give a "git add ." - now it seems everything's under VC but if when i drilled down in project tree i've found for example "build" folder not checked with git sign icon.

Tried every command like "add -f" and "add *" and such, no way. Sometimes it seems fooling me around adding something that wasn't added before, but remove something else from the list of versione files!

Really really inexplicable.

Thanks

Black.Jack
  • 1,878
  • 2
  • 22
  • 39
  • Is there a `.git/info/exclude` file? (as in http://stackoverflow.com/a/20796585/6309) – VonC May 16 '15 at 10:55
  • 1
    Well, don't know if you have your reasons to do that, but you really shouldn't versionate every single file.. – Lucas May 16 '15 at 11:04
  • Also take a look at [What should be in my gitignore for an Android Studio project](http://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project) – Dalija Prasnikar May 16 '15 at 11:09

2 Answers2

1

If you're going to use git I recommend you go through this quick tutorial http://www.gitimmersion.com. It takes about 2 hours all-in, but you'll have a strong foundation in git when you're done.

Bill Mote
  • 12,644
  • 7
  • 58
  • 82
  • this is absolutely a good advice, but sir, 2 hours for learn in deep versioning? In 2 hours i've started to program Android from 0...versioning is important but a good instrument is also user-friendly imho. Anyways put a point to you! – Black.Jack May 16 '15 at 11:40
  • 1
    2 hours isn't so bad when you're going to be using version control from now until the end of your career :P There's no "get rich quick" path with git and not knowing how to wrangle it to your will is going to cost you much more than 2 hours down the road. That's a promise. Invest now and it will pay dividends later. – Bill Mote May 16 '15 at 15:18
0
  1. why and how git decides alone that there are things to ignore here

The gitignore files are not created by git but I asume by Android studio and they do make sense. You can still decide to delete them.

  1. You probably have 2 gitignore files, one in the project folder, one in the app module folder. After deleting them both, all files should be added.
fweigl
  • 21,278
  • 20
  • 114
  • 205
  • That's it. 2 ignore files! But why? If i do a git init in a file, from bash, i can't imagine AS is so smart to interfere and say what's ignorable...mmm. Also if i put a project under VC i'm expect to retrieve the same project from 0 if i lost mine. Without all the ignored files..i'm not very sure that could happen...but i could be wrong. – Black.Jack May 16 '15 at 11:42
  • .gitignore is a blessing! You should only be committing files that are necessary for the next developer to clone your repository and build. Everything else is static/noise. Look at what gets committed here and checkout it's .gitignore file: https://github.com/androidfu/EtPushHelloWorld – Bill Mote May 16 '15 at 15:20