Home > other >  Git learning notes 1
Git learning notes 1

Time:09-23

1. The command:
CD: X into a certain dish/folder
The PWD displays the current directory
Git init the target directory into git to manage warehouse
Git add XXX add files to the staging area
Git commit -m "XXX" will documents submitted to the warehouse, double quotes for comments
Git status to check the warehouse, to see whether there is any documents have not been submitted
The content of the git diff view the changes in the XXX XXX
The git log view history record
The git log - pretty=oneline shows a brief history
Git reset - hard HEAD ^ back on a version
Git reset - hard HEAD ^ ^ back to last version
The content of the cat see XXX XXX file
Git reflog before obtaining the version number of the
Git reset - hard XXX to XXX version
Git undo checkout - XXX XXX files in the workspace changes
The rm file delete XXX XXX

Branch management:
Git merge - no - ff -m "merge with no - the ff" dev merge dev branch - no - ff disables fast forward

Create and merge branches:
Create and switch git checkout - b XXX branch XXX
Git branch view the current branch
Git branch create branch XXX XXX
Git checkout branch switch to XXX XXX
Git merge the merge XXX XXX branch to the current branch
Git branch - delete d XXX XXX branch

Local to the remote:
Git remote add origin XXX push local warehouse to making the content of the
Git push -u origin master the local branch of the warehouse master content is pushed to the remote repository (-u because the remote repository is empty)
Git push origin master amend the local branch of the master's latest push on to making

Remote to local:
Git clone XXX will be making on remote library cloning to the local library

2. Key position: users - & gt; Wuli - & gt; . SSH
Id_rsa is the private key, can't leak
Id_rsa.pub is the public key, feel free to tell

CodePudding user response:

Reminds me of that year just graduated, into the company internship, remember this thing, in the desktop of the note, and use it every time you look at,
  • Related