Original URL: http://blog.csdn.net/u011439289/article/details/42126507
Today began to participate in the company's project code writing, the company adopted the Gitlib, so used to Sourcetree, team development code for me is the first time, feel a bit fresh, and I installed this sourcetree is completely Chinese version, operation up also no problem!
Click on the icon in the lower left corner to download the item locally. Jump out of the window, enter the address of the project, click Elsewhere, will parse, and then click "Clone", you can download to the local.
Then open with IntelliJ idea. Because our company is using MAVEN's modular project architecture, we choose to open the Pom.xml on the root directory.
The project structure is as follows:
Then load the dependent jar package on it.
When the code is written in, the newly added file will jump out of the query box, prompts whether to cache to the local warehouse, select "Yes", the file is represented in green, indicating not yet submitted to the remote Git repository, select "No" is displayed in red, indicating that there is no cache in the local git repository, Also did not commit to remote. Once the file has been submitted to the remote repository, it becomes a white normal color, and has been modified, it will become a blue hint color.
Using IntelliJ can be used directly with GitHub, but Gitlib will not be able to, so also need to use sourcetree this tool.
When there are code changes in the project, IntelliJ will prompt for a variety of different colors. Open with Sourcetree and click "Uncommitted changes". The changed file is shown in yellow in the "2" area, and the new file is shown in blue below. Unfold is the change that appears in the "3" area. Click "4" to temporarily save the selected. Or, right-click Submit.
Jump out of a window:
The word "master" in the lower right corner indicates the submission to the "master" trunk. You can also select a file after staging.
Sometimes your own personally developed code does not want to commit to the main branch, and you can create a new branch.
You can either right-click on the "branch" entry or select "Branch". Then switch on the branch and double click on the branch you want to switch to.
Branches are different, the lower-right corner will be displayed:
You can see the commit:
But this is only submitted to the local, but also to be submitted to the remote, so to "push":
Push to Branch "LHX2":
The display is different:
Switch back to the "master" branch and you can see that there is a branch:
On the internal network to look at, there are information tips:
Then delete the branch:
Then delete the branch:
After confirmation, there is an error:
Tip To switch to another branch to delete, that is, the branch you are occupying cannot be deleted. You can delete a different branch after you select it.
Use IntelliJ to copy git projects from remote.
Get the address of the project on the GIT site first.
Jump out of the window, copy and paste the address in
Click "Test", in the case of networking generally no problem:
Click "Clone", the following version of the control window will show some hints, in fact, the background is also the implementation of GIT commands, but it is intellij to help us automate the implementation of it.
The last item is imported locally, and you will be asked if you want to open it as an item in the following window. Click "Yes" to load the Pom.xml and load the project into a new window!
Simple use of "turn" sourcetree