John
John

Reputation: 1

cannot add/push google-services.json in android studio to github

I downloaded google-services.json file and put it in my local machine. I committed and pushed it to my github repository. When I tried to pull from the github repository on my other PC, I could not see the google-services.json file.

How can I push google-services.json file to github? Or is it not possible at all because it contains confidential information?

But I saw some people could add the file on their github repository.

Upvotes: 0

Views: 1782

Answers (2)

Evgeniy Mishustin
Evgeniy Mishustin

Reputation: 3804

The reason is "google-services.json" is added to .gitignore. At big projects it may be bot an easy task to find an ".gitignore" that contains such exclusion. You may force-add your file, that will add it to git:

git add someProject/src/someFlavor/google-services.json -f

Upvotes: 2

creyD
creyD

Reputation: 2126

git add + git commit + git push should do the job? Are you sure you added the file and committed it? Was it shown in the commit? If you work with GitHub was it shown online?

How can I push google-services.json file to github? Or is it not possible at all because it contains confidential information?

No, Git/GitHub doesn't check whether information is confidential or not.

Edit: The file was mentioned in the gitignore file. That was the reason why the problem occurred.

Upvotes: 1

Related Questions