How To Upload An Android Studio Project To GitHub?

448 Views
0 rating based on 0 reviews

Have you ever wondered how to upload an Android Studio project to GitHub? You've come to the right place. I've spent a lot of time working on tutorials for Android Studio. During this time I've learned a lot of new things and tried out lots of things that I never expected to work. One of these is how to upload an Android Studio project to GitHub. I'm going to walk you through the process that I've developed and used many times in my own projects.

Upload an Android studio project to GitHub

GitHub is an open-sourced cloud-based platform where developers and people share their source code and works for others to view or make changes as a team in a project and track the entire history for changes made to the code.

When a developer makes something, he has to constantly update it meeting the specific criteria of the users, updated technologies, etc. The operating system built for mobile phones is called Android. Android uses Linux Kernel as its base while other open-source software and is developed by Google. The application in which the Android system interface is developed known as Android Studio.

Uploading an Android studio project on GitHub may seem easy for professional developers as they are familiar with the process as they are working with it all the time, but for beginners, this attempt may be a bit difficult if you don’t have the proper directions.

Luckily, we are here to elaborate you the method of uploading your Android studio project to your GitHub account. Please follow the following steps:

  1. If you don’t have a GitHub account then sign up to their website and create a GitHub account.
  2. If you don’t have Git then download the git application from https://git-scm.com/ downloads and install it on your desktop system. Sometimes it doesn’t show the .exe file easily. So, you would need to work hard to search the Git.exe files.
  3. Open your project in the Android studio application and go to “File”. Select “Settings” and go to “Version Control” and then click “Git”.
  4. Click on the test button to test "path to Git executables". Everything will ok for the next steps if a successful message is displayed, otherwise, navigate to the webpage of the git installation and attempt it again. You cannot advance to the next step unless a successful message is shown.
  5. Now go to “File” and from there go to “Settings”. Look for “Version Control” and select “GitHub”.
  6. Sign in to your GitHub account by typing your email and password and click on the “OK” button.
  7. Then go to “VCS”.
  8. Click onto “Import into Version Control” and then click “Share Project on GitHub”. You have to type the Repository Name, Description. For repository names, don’t put blank spaces or special characters.
  9. After you have finished typing it click the “Share” button.
  10. Check all files when the next window appears if you want to add files for the initial commit and then click OK.
  11. Your project will be uploaded to the GitHub repository and when uploading of the project is finished you will receive a message in Android studio showing "Successfully shared project on GitHub".
  12. If you click on the link provided in that message, it will take you to the GitHub repository.

Using the Command Prompt

From the command prompt, you can also add your Android studio project to GitHub. To do so, follow this method:

  1. Open your GitHub account on your desktop interface and create the project.
  2. Run the command prompt, go to the project directory, and type the following lines of code in the terminal:
    git init
    git remote add origin https://github.com/xxx/yyy.git
    git add
    git commit -m "first commit"
    git push -u origin master
  3. Click “Enter”. You will have successfully uploaded the project to GitHub.

Summary: Upload an Android studio project to GitHub

  • Open Android Studio.
  • Select the "VCS" drop down menu.
  • Select "Import into Version Control" and then select "Share Project on GitHub".
  • Add your GitHub username and password and then click on the "Login" button. If you haven't set up a GitHub account, go to https://github.com first.
  • You should see a list of all your repositories. Type in a repository name and description of your choice and click on the "Share" button.
  • That's it! You just shared an Android Studio project on GitHub!