How does android studio share projects with Git @ OSC, androidgit @ osc
I am the first to post this article. If anything is inappropriate, please criticize and correct it.
1. Install git. Git: http://git-scm.com/downloads/
2. Configure the git.exe command path in File-> Settings-> Version Control-> Git of AS, for example:
Configure AS git
After the configuration is complete, if you click "Test" to prompt successfully, the configuration is successful.
3. Create a repository on git @ osc to get the repository address.
Here my repository address is: https://git.oschina.net/qule510/GitDemoTest.git
4. Create an AS project.
5. Select a project in AS to create and initialize the local git repository. For example:
6. (enter the Key Point) enter the project directory and right-click the git command line window.
First, you need to execute the following two commands, as the basic configuration of git, To tell git who you are and the information you enter will appear in the commit you created.
Git config -- global user. name "your name or nickname"
Git config -- global user. email "your mailbox"
If you have already set it, ignore the above steps.
Enter the following command:
Git remote add origin <your project address> // here my remote repository address is: https://git.oschina.net/qule510/GitDemoTest.git
Git pull origin master
Git touch init.txt // this step is not required if a modified file already exists
Git add.
Git commit-m "first commit" // enter the submitted content here
Git push origin master // push
Follow the steps above to successfully share
If a problem occurs during the update, the following error occurs: Can't update: no tracked branchNo tracked branch configured for branch master. To make your branch track a remote branch call, for example,
Git branch -- set-upstream master origin/master
Execute git branch -- set-upstream master origin/master to update it.
Tip: For more detailed steps, you can view the OSC git help documentation: http://git.mydoc.io/