How to connect existing Android Studio project to existing Github repository

后端 未结 6 1784
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 04:08

So I am new to Android development and Android Studio.

I used Android Studio to create an Android project, and each time I wanted to commit the code to GitHub, I swi

6条回答
  •  抹茶落季
    2020-12-08 04:47

    Connecting existing Android Studio project to existing Github repository

    If your local project is newer than the one on GitHub, then you can temporarily move it to another location, import the GitHub version into Android studio, delete these old files, and copy in the new files. Then push the changes back to GitHub. The directions to do all of this are here. This takes some command line work, but after it is set up, you can do any future commits right in Android Studio.

    Committing and pushing to GitHub from Android Studio

    After making a change, you can commit it by selecting the app folder in the Android view (or the main project folder in whatever view you are using). Then go to VCS > Git > Commit Directory....

    Add a commit message and click Commit.

    Then go to VCS > Git > Push to push your changes to GitHub.

    That's it.

提交回复
热议问题