AndroidStudio and github complete the association of local warehouse and remote warehouse

1. First complete the basic information association between AS and github:

1. Create a new as project or open an existing as project

2. Enter File->Settings->Version Control->Git, select the installation path of git:

3. Click test to see if the configuration is successful. If successful, the git version can be displayed:

 4. Go to File->Settings->Version Control->GitHub and associate github:

        Click the plus sign, there are two ways to add, the token is selected here, if github does not set a token, you can directly jump to set a token according to the generate prompt. Finally, copy the token to add the corresponding github account. (After apply, it is ok. If the icon lights up, it is successful, and if it turns gray, it means it is invalid.)

2. Upload the project to github:

1. Enter VCS->Share Project on GitHub, and add the corresponding information:

 2. When initializing information according to the prompts, the following errors may occur:

 3. Don't panic! fix it:

        Enter a qq mailbox and enter a user name

git config --global user.email "[email protected]"  
git config --global user.name "Your Name"

 4. When using the git command to upload the project, another problem occurred:

5. Continue! as follows:

        The reason for this error is that there are no files in the directory, and an empty directory cannot be submitted. Enter the following commands in turn:

touch README
git add README 
git commit 
git push origin master:master

6. Go to github to see the submitted project, and then follow the normal git related instructions to realize the association between the local warehouse and the remote warehouse.

Guess you like

Origin blog.csdn.net/xiaokang666/article/details/130549743