Initialization work:

Git config –global user.name Specifies the user name

Git config –global user.email Git config –global user

Git init initializes the local library

Git status Displays the status of the local repository

Git add The file name to the staging area

Git commit -m “Log message” file name commit to local library

Git reflog Displays historical records

Git reset — Hard version number version shuttle

Branch operation:

Git branch Branch name creates a branch

Git branch -v Displays branches

Git Checkout branch name switch branches

Git merge The git merge branch name merges the specified branch into the current branch

Create a remote repository alias

Git remote -v displays aliases of all remote addresses

Git remote add Alias Remote address Add the remote address

Git push alias branch names are pushed remotely

Git pull Alias branch name Download remote library content locally

Git Clone Remote address to clone code locally

Non-personal modification

Note that teamwork requires users to be invited in. Otherwise, it can only be clone, not push

The non-team forked on Github and then found pull Requests on the web page after modifying the code. The developer approved the request.

SSH Encryption-free login

Ssh-keygen -t rse -c Mailbox Generates a key. Add a public key to Github.

The IDEA of integrated Git

Create a *. Ignore file, preferably git.ignore, in your home directory

Ignore files and just write them in, like

*.class

Then reference this file in git.config

[core]
   excludesfile = "pathOf*.ignore"
Copy the code

Git cache cleanup:

Git rm -r –cached. Git cache cleanup, used for example to refresh git.ignore