Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
408 views
in Technique[技术] by (71.8m points)

git - Why build and libs folders in Android project can't be commited or pushed?

I'm using Android Studio in combination with GitHub repository. So I have just pushed my entire project but I mentioned that I can push only my src folder. Is there any reason that I can't push my build and src folders or just I'm doing something wrong? When I'm trying to commit them I'm receiving a message telling me that there is no changes detected, but when I go in my repository there is no such folders.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By default Android Studio puts the build directory (both at the project level and the module level) in the .gitignore.

This is typically the desired behavior, as there is no reason to keep most of the generated files in version control. Gradle will create these again for you on any machine you download the project to.

If you want to include the build directories, simple remove /build from both the .gitignore in your project's root and the .gitignore in your module's root.

The libs directory should not be in there by default, but if you are adding files to that directory and Git isn't recognizing the change, that's where I would look.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...