How do I keep library files out of my github repo yet still have them work if someone downloads my code? I get about 600 "changes" each time I make a small change to my code! Also if it changes anything I am using github desktop (not through cmd). Thanks in advance!
Asked
Active
Viewed 200 times
0
-
Possible duplicate of [How to create .gitignore file](http://stackoverflow.com/questions/10744305/how-to-create-gitignore-file) – OneCricketeer Oct 08 '16 at 08:38
-
Note: This topic isn't really Android or GitHub specific. It applies to all Git-based projects – OneCricketeer Oct 08 '16 at 08:39
2 Answers
0
you need to use git ignore to ignore your build folders from updating with git. git ignore helps you to make a blacklist of items you dont want to commit everytime.
you can see how to make a git ignore file in below:

Community
- 1
- 1

Amir Ziarati
- 14,248
- 11
- 47
- 52
-
Thanks for the how to link! But where do I put the git ignore? I get a ton of different files every time I make one small change :/ – Tal C Oct 09 '16 at 09:13
-
make a .gitignore file and add it to this path : `YOUR_PROJECT/app/1` beside your src forlder. you need to delete those previous files, becuase .gitignore file prevent pushing files from now on. to delete files in git that you want to stop them being in git from now you must delete the so : `rm {filename}` – Amir Ziarati Oct 09 '16 at 09:18
0
I guess you see changes to the workspace files modified by Android Studio / IntelliJ in the .idea folder. These files are automatically re-generated if you remove them and should be private to each user, i.e. not uploaded to source control with git.
Step by step fix
- Close Android Studio
- Remove the .idea folder in your project root (or backup elsewhere for now)
- in the .gitignore file in the root of your project, add a line containing just
.idea
to ignore the folder and its content when you use git - Commit changes to git which should be the removal of the .idea folder & the .gitignore change
- Open Android Studio, re-import you project
- .idea folder is now regenerated and private to each git user
- Run
git status
to verify

Pär Nils Amsen
- 755
- 5
- 16
-
Thanks for the answer! So the idea folder is where the library files that are generated by Gradle are stored? – Tal C Oct 09 '16 at 09:12
-
Workspace files automatically generated for each user, I'm consulting and have seen a lot of Android codebases, most teams have had the .idea folder ignored from my experience – Pär Nils Amsen Oct 09 '16 at 10:41