I wrote that phpstorm uses Git before , but the writing was too messy, so I rewrote it. I usually use PHPstorm and Webstorm of the jetbrains family as the main development tools.
PHPstorm, Webstorm and other jetbrains family software use git operations almost exactly the same.
First of all, you must install Git on your computer and configure the secret key (if you use the ssh protocol). You can refer to the third section of Linux installation git and key addition : generate and add keys.
Take webstorm as an example: the demo address
of this article
1. Pull the warehouse code
1. Create a new warehouse (if there is an existing warehouse, please ignore it)
2.
Pull the warehouse code
and paste the warehouse address:
2. Upload code
Code change area color description:
1. New file upload
Create a new test.js file. Files that are not added to the warehouse will be displayed in red. If they are
added to the warehouse, they will become light green. If they are not added to the warehouse, these files will not be pushed when the code is submitted. go up.
2. Submit the code
The shortcut key is: Ctrl+K
if you just want to save it temporarily, you can select commit first, and then push when you want to push. The shortcut key is: Ctrl+shift+k
if you want to submit after committing, select Commit and Push
push. After that, the code warehouse can be seen own code
3. Modify the code
1. Modify the code
If it is a new line of code, the color is light green
If it is to modify the original existing line of code, it will become light blue, and the color of the file with the modified code is also blue
2. Rename the file
4. Update project code
Shortcut key: Ctrl+T
or
can pull the latest code version in the remote warehouse to the local branch
5. Rollback
1. Local one-line recall
Click the color area of the number of rows on the left with the mouse, and select the rollback line.
2. Batch recall on this page
Click the recall symbol/shortcut key on the right: ctrl+alt+z
, Mac keyboard alt is the option key to
withdraw all, and then select directly in the pop-up rollback
If batch selective operations are required, double-click to change the file
3. Roll back the warehouse code At this time, the code you want to
roll back is already in the warehouse . Select the git history
flag . You can roll back the local code 2. The code history of the git warehouse . Right-click to select git history. This file git history: project all history: you can also choose to specify the branch, specify the submitter and other filter conditions 3 .Comparing the code with other branches of the git repository
6. Recent Changes
This is the latest local change
Shortcut alt+shift+c
mac: option+shift+c
This is very useful
Other non-Git operations will be updated later