## Git use tips
Git installed
MAC: 1, download Git installer, address; http://git-scm.com/downloads
2, download and open, double-click. PKG install
3, open the terminal, use git –version or which git command to check the installation version, if it is successful
4, create a global username, global email
git config –global user.name “YOURNAME”
git config –global user.email “YOUREMAIL”
5. Open the terminal after the installation is successful
CD ~ Go to the root directory
Type ssh-keygen to generate ssh-key. If prompted, press Enter
Win side:
1. Open the browser and enter Git official website and press Enter to open Git official website.
2. Click “Downloads for Windows” inside to adjust to the download page and wait for the download. Now the latest version is 2.10.1
3. The installation package I downloaded is called git.exe.
4. Double-click to open the installation page. Then click “Next”;
5. Configure the installation components by default and click Next. The default has already helped us not to select. This includes creating desktop shortcuts, Git Bash, Git GUi, associating existing directories and suffixes, etc.
So in ‘Adjusting Your PATH Environment’, default is ok. Click “Next”;
Use Git from the Windows Command Prompt to run Git commands on the Windows Command line. This will bring convenience to some operations in the future);
6. Configure the end of the line marker, default “Checkout Windows-style, commit UNIX-style line Hamed”;
7. In the terminal emulator selection page, the default is ok;
8. Configure Git and select default.
9. Click Finish by default.
10. After the installation is complete, enter the following command line interface (CLI) :
## Common commands
$git config –global user.name”Your Name”
$git config –global user.email”YOUR email” specifies the git config path command
$git init initialization
$git status Check the current status
$git rm Delete
## Advanced command
Git remote origin “XXXXXXXXX” add a remote repository
Git remote -v Check the status
Git push -f origin master force push
Git remote remove gitlab Deletes the gitlab tag
Git branch XXX creates a branch
Git checkout XXX switch to XXX
Git push origin XXX to the trunk