Managing code with Open source China (Oschina) git (Consolidated IntelliJ 13.1.5)

Source: Internet
Author: User
Tags git client

Introduction Open source China offers a git service (address: http://git.oschina.net/), which is much faster than a foreign github. It feels good to use it for a while. Oschina git provides a demo platform to run code that commits to git (note that if it's a Java project, the project is a MAVEN project), such as:
The supported application types are
This article describes the use of the GIT client to manage remote Git code in the Windows platform and integrate it into IntelliJ.
1. Create your project into Http://git.oschina.net/projects/new and follow the prompts to get it right. Recommended to start with a private project

2. Using the GIT client to manage code 2.1 download & Install Git client if you already have a GIT client, you can skip this step. To http://msysgit.github.io/
At the time of installation, choose according to your actual situation. After completion in the Start menu there is a git directory


Open git bash, you can use the GIT command to code the operation, here is not detailed.
3. IntelliJ use git This section is mainly about if you use Git in IntelliJ, show configuration git, and then I divide the code management into two cases: share a local existing project, check out the project from git to local 3.1 Configure Git to open the IntelliJ setting page and follow the configuration
Path to git executable select the paths of the Git client. Click on next to test (not in the) detection, the following similar window appears to indicate OK
3.2 Share local code to a GIT server this situation is to share the local IntelliJ project to the GIT server. 1. First turn the project into a git project, step: Vcs--import into Version control--create git Repository in IntelliJ to select your local project in the popup window, and then you will have it in the project directory. Git Folder
2. You need to associate a local git to a git server (you need to create a project in Oschina git and then copy the Git address of the project) and Git bash into the project root directory
Execute: Git remote add Origin https://git.oschina.net/0604hx/d3lesson.git (Note that https://git.oschina.net/0604hx/ D3lesson.git is the address of my project, please replace it with your own project in actual use, after entering the user & password, complete.
3. Execute GIT push-u origin master
If the submission fails, please refer to the GIT prompt to resolve such as already have remote address can git remote RM origin Clear if there is no other file in the warehouse local project can reference after two diagram first merge project using: Git pull Origin Master Then in the implementation of the GIT Push-u Origin master project submitted to [email protected] After the change to submit the warehouse can refer to method one of the push operation of 4. Error encountered and solution a) if you enter the GIT remote Add origin hint error message: Fatal:remote origin already exists.
The workaround is as follows: Enter $ git remote RM origin
b) If you enter the GIT push origin master prompt error message: error:failed to push som refs to .... The workaround is as follows: First enter the GIT pull Origin master//start the remote server github above file and then enter the GIT push Origin master
c) If an error occurs FATAL:COULDN ' t find remote ref Master or fatal: ' Origin ' does not appear to be a git repository and fatal:could not Read from remote repository. You need to re-enter Git remote add origin ... 3.3 Get the project code 1 from the GIT server.
Enter the Git address in the pop-up window, and the local save directory will be available. After a series of settings, the project is synchronized to the local.
3.4 Commit code to a git server when we modify the local code, we need to commit to the server (in IntelliJ, if the file is modified, the filename is red), then we can right click on the project
If a new folder or file is added, add it to git version control, or you will be prompted not to modify the content. In the example I added the CSS directory, as well as the Style.css file. I add them to git, and I can see the action record in the Version control view.

After the add, select the Commit Directory
The commit Message cannot be empty, and then you can select "Commit" or "commit and push", which is generally selected, which can be updated directly to the server, and if only commit is selected, you can push to the server in the following menu:

Finally, look in the Oschina, the papers have been submitted.

Note: 1. Git does not speak empty directory to add version control, for example, there is a images folder below, it is empty, then git will ignore it. To add an empty folder to version control, you can refer to: http://www.myexception.cn/open-source/1740537.html




From for notes (Wiz)

Managing code with Open source China (Oschina) git (Consolidated IntelliJ 13.1.5)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.