Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java files are not being pushed to github

Android studio is not pushing java files to github. I found that it only pushed the src folder with the res (layouts and xml docs) folder. I tried adding the java folder to it (right click, add, then commit directory, and push), but it still does not push the java files to git.

Used this setup: https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/

.gitignore:

.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build

When I right click on the Main folder (which holds the java files) and select commit directory, I get the following error:

Error:On branch master
nothing to commit, working directory clean
 during executing git commit --only -F C:\Users\mmm\AppData\Local\Temp\git-commit-msg-999645.txt -- MainActivity.java
like image 770
user2883071 Avatar asked Aug 12 '26 00:08

user2883071


1 Answers

Did it through gitbash following the instructions here: https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/

Right clicked on the main folder (containing the java files) and selected gitbash.

like image 81
user2883071 Avatar answered Aug 15 '26 01:08

user2883071



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!