Skip to content Skip to sidebar Skip to footer

How to Upload an Android Studio Project to a Gitub Repository

Subscribe to my newsletter and never miss my upcoming manufactures

Table of contents

  • Stride ane - Sign Upward GitHub and Install Git
  • Stride 2 - Enable Version Command Integration
  • Step iii - Share Projection on GitHub
  • Make Changes to Your Files
    • Step 1 - Commit your files
    • Footstep ii - Push button your files
  • Show Diff Before Commit
    • Step one - Show Diff
    • Step 2 - Select "footstep-by-stride viewer"
    • Step iii - Review and Make Changes

The good thing well-nigh using Android Studio to upload your files to GitHub is it automatically figures out for you what files are required to commit and button to GitHub. For example, generated files are non required to commit and push to GitHub.

The following provides the pace-by-step instructions on how yous can upload your Android studio projects to GitHub:

Step 1 - Sign Up GitHub and Install Git

  • Sign up github.com
  • Download and install git from hither

Step 2 - Enable Version Command Integration

  • In your Android Studio, go to menu "VCS→Enable Version Control Integration..." android_studio_share_to_github_01.png

  • Select "Git" and click "OK" android_studio_share_to_github_02.png

Update: Feb 8, 2022: I learned that the .thought folder is unnecessary to be committed to repository because those files are specific to IDE configurations, which could be different per developer. In this example, you can update the .gitignore file to exclude them.

  • Update .gitignore to ignore the entire .idea binder (optional step)

In your root project folder, you should come across .gitignore which take the following default ignore for sure files and folders in the .idea folder.

Replace these

                          /.thought/caches              /.idea/libraries              /.idea/modules.xml              /.idea/workspace.xml              /.idea/navEditor.xml              /.thought/assetWizardSettings.xml                      

With

                          /.idea                      

To ignore the entire .thought folder instead.

  • Become to card "Git→GitHub→Share Project on GitHub" android_studio_share_to_github_03.png

  • Login GitHub business relationship either via GitHub website or with token. GitHub website login didn't work for me. Then I ended up use token instead. android_studio_share_to_github_04.png

  • Click "Generate..." and follow the instructions to get the generated token

  • Re-create and paste the token, click "Add Business relationship" android_studio_share_to_github_05.png

  • Name your repository name, check "Private" if you desire to create a individual repository. Then, click "Share". A new repository is created. android_studio_share_to_github_06.png

  • Click "Add" to commit your files android_studio_share_to_github_07.png

That is it. Your projection now has been uploaded to your GitHub repository. Later you make some local changes to your file, yous demand to commit and push those changes into a GitHub repository. The post-obit steps testify you lot how to do that.

Make Changes to Your Files

Pace 1 - Commit your files

  • Click "commit" in the meridian right corner. Yous can also become to menu "Git→Commit" android_studio_share_to_github_08.png

Step 2 - Push button your files

  • Enter your commit description and click "Commit and Push button..." android_studio_share_to_github_09.png

  • At that place are lawmaking analysis warnings, you lot can either review them or simply go ahead to push your files android_studio_share_to_github_10.png

  • Click "Push button". Your files have been updated in the repository android_studio_share_to_github_11.png

  • You can also click "Commit" and push your files later on on. To push your files, click "push" in the top right corner. Y'all can also become to menu "Git→Button". The rest of the steps are very similar to "Commit and Push" above. android_studio_share_to_github_12.png

Another common thing I practice before I commit the files is review my changes. The following steps bear witness you how y'all can review and make whatsoever changes to your files in the committing screen.

Bear witness Diff Earlier Commit

Stride i - Evidence Diff

  • Select a file, correct click and click "Show Diff" android_studio_share_to_github_13.png

Step 2 - Select "stride-by-step viewer"

  • By default, it is "Unified viewer" which I don't similar. android_studio_share_to_github_14.png

Step 3 - Review and Make Changes

  • Now yous tin review your change. Yous tin likewise make changes to your file from this window. android_studio_share_to_github_15.png

Hope this helps! I'm new to GitHub and this is what I do to commit and push button my Android projects into my GitHub repositories

Did you find this article valuable?

Support Vincent Tsen past becoming a sponsor. Any amount is appreciated!

killeenthatter1999.blogspot.com

Source: https://vtsen.hashnode.dev/how-to-upload-android-studio-project-to-github

Post a Comment for "How to Upload an Android Studio Project to a Gitub Repository"