two different ways:One is the check out remote code project to local (local originally no project)one is that the local project is submitted to the remote server (no project on the remote server)
Method One : Please refer to the article:http://www.sxt.cn/info-6043-u-7372.html Blog
mode Two applies to existing projects
step: In Vcs--import into Version control--create Git Repository Select your local project in the pop-up window
then select the folder where your project is located: This means that you are one of the paths to version control of this folder
After confirming, the project on the path selected in the previous step is ready for version management (but only locally)
Be
careful to modify the. gitignore file: If not, create a new one if you have one: Configure files that do not need to be uploaded, so that there are many unnecessary files for the next commit
wording Reference: /. Idea
. Gradle
*.IML
/local.properties
/app/Build. Gitignore
Right-click on the project, you will find a git menu bar;
Next we'll add the code to the repository: 1) Right-click the project Git +add (add the modified file to the directory you want to upload) in the version control bar you will see the code we need to submit
2) Right-click Project Git commit dictory Normal commit modified code
3) Commit Changges interface We choose commit and push (because commit only commits to the local, push is committed to the remote server)
4) in the push commits interface we click Define remote (because we do not have this branch, so we need to configure), and fill in the path of submission (if you need to login, enter password account login)
5) After clicking OK, if connected, click Push so that our project is submitted to the remote server
A commit can also be used in the form of a command line:
Then associate the local git to the GIT server (you need to create a project in Oschina git and then copy the project's Git address).
Use Git bash to enter the project root directory
Perform:
git remote add Origin https://git.oschina.net****** (please replace your own item in the actual use)
After entering the user & password, complete.
after executiongit push-u Origin master
Androidstudio Git (commit to existing project and get project from remote to local)