1

i have some problem on uploading my Android project to Github repo.

The problem is that I can't add my 'manifests', 'src/drawable', 'src/layout', 'src/value' folders(that have *.xml files in common).

I already checked my .gitignore file and tried to push using Android Studio(VCS), terminal command, etc.

here's my .gitignore file.

*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild

Thanks!

  • here's the 'Add File For Initial Commit' Add File For Initial Commit

  • and also the terminal command screenshot terminal command screenshot

kujyp
  • 38
  • 5

3 Answers3

0

Make sure you first create the git file using

git init

Then you add the whole project to it

git add .

You can check if there's something missing using

git status

If there's everything you can commit

git commit -m "First commit"

Add the remote repo to your project using

git remote add origin yourProject.git

And then push it to your repo

git push -u origin master

And if you need to setup your user and password (if it's your first time) here's an example to how to do it Set user and password

Try to re-install Android studio again because it seems that is problem with your Android Studio internal configuration.

Skizo-ozᴉʞS ツ
  • 19,464
  • 18
  • 81
  • 148
0

I found solution.(Especially thanks to KUJYP)

I had .gitignore-global file on my parent folder.

and it was

*~
.DS_Store
Project_Default.xml
*.xml
venv
build_file_checksums.ser

so i deleted that '*.xml' and it worked!

thanks to 'Skizo-ozᴉʞS' for helping me out and KUJYP!!

have a good day!

enter image description here

  • also check out this link : https://stackoverflow.com/questions/12144633/explain-which-gitignore-rule-is-ignoring-my-file – Chanjoo Lee Apr 01 '19 at 16:47
0

Check the reason via git check-ignore -v <FLIE_NAME>

Here's the result of questioner's. In his case, ~/.gitignore_global causes the problem.

$ git check-ignore -v colors.xml
> ~/.gitignore_global:4:*.xml colors.xml

$ cat ~/.gitignore_global
> *~
> .DS_Store
> Project_Default.xml
> *.xml
> venv
> build_file_checksums.ser
kujyp
  • 38
  • 5