简体   繁体   中英

Which way is correct when I integrate GitHub to my Android Studio 3.3.1 project?

I hope to use GitHub in my Android Studio 3.3.1 project. I google some ways, I find the ways divide into two way.

Way 1: Such as https://medium.com/code-yoga/how-to-link-android-studio-with-github-312037a13b99

   It need  VCS > Import into Version Control > Share project on Github

Way2 : Such as https://www.londonappdeveloper.com/how-to-use-git-hub-with-android-studio/

   It need VCS > Import into Version Control > Create Git Repository.

What are different between Way 1 and Way2 ?

What are different between Share project on Github and Create Git Repository and Other operations ?

Way 1 is very simple, but I don't know if it's correct.

In the 2nd link you posted : the author guides you through the following steps

  1. create an empty git repo on github throught github's web GUI
  2. create a project and an empty repo on your local machine
  3. link your local repo with the remote repo on github (through a cli command : git remote add ... )

In the 1st link you posted :

steps 1. and 3. are managed through the IDE, when the author describes the step "3. Share on Github"


a note about the "private" flag : when following the walkthrough of the 2nd article, you can select "Private" in github's GUI when you create the empty repository on github.

1st way - you're going to share your current git repository/project to online with Github.

2nd way - The first phase to make a project to turn into a git repository. You must make this thing first before uploading in Github.

1st way: y are sharing your code to you git repository if you already have one else you will create a new repo and then add files This command creates an empty Git repository—basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. An initial HEAD file that references the HEAD of the master branch is also created.

2nd way: in second way you are making your localfiles as your local reppository which you can puch and merge in you online git account

you certainly would want to take a look at this awesome and simpolified tutorial of whole git process. Hope it Helps happy Coding; exit();

Way 1

You have git enabled local project not in github, so you have to upload to github. thats why it says

VCS > Import into Version Control > Share project on Github

Way 2

Initially, you create a new empty git repository on github, after that you created android project (not a git project) then push your code to git repository

I always use 1st way

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM