How to push Android Project to existing private em

2020-06-16 02:05发布

I am trying to push android project to private empty repo with android studio . But I cannot find simple solution. How can I do this ?

2条回答
Bombasti
2楼-- · 2020-06-16 02:56

If you are pushing to a private repo in a local location ie. a private server.:

  • Assuming you have set up local git repository, cd into the remote location and clone your local repository with git clone 'path to local repo'

  • cloning will set the local repo as a remote, so we have to remove that with git remote remove origin

  • make the remote repo bare with git config --bool core.bare true

  • Then in your local repository add the remote with git remote add origin 'location to remote git repo'

Now you should be able to push to remote in Android studio.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2020-06-16 03:03

Github helpfully provides a guide for adding an existing code base into a repository which already exists, here. Whilst not specific to android studio, it will allow you to use whatever normal commit method you use.

In a nutshell:

  • navigate to your code repository
  • run the command git init
  • add the files to commit with git add .
  • commit the changes : git commit -m "your commit message"
  • add the remote origin : git remote add origin your@git:repo/name
  • verify the remote URL git remote -v
  • push the changes git push origin master
查看更多
登录 后发表回答