Common Git commands and common Git commands
Mkdir:XX (create an empty directory XX refers to the directory name)
Pwd:Shows the path of the current directory.
Git initChange the current directory to a manageable git repository and generate a hidden. git file.
Git add XXAdd xx files to the temporary storage area.
Git commit-m "XX"Comments are followed by the submitted file-m.
Git statusView repository status
Git diff XXView the modified contents of XX File
Git logView historical records
Git reset-hard HEAD ^OrGit reset-hard HEAD ~Roll back to the previous version
(If you want to roll back to version 100, use git reset-hard HEAD ~ 100)
Cat XXView XX File Content
Git reflogView the version number id of the History
Git checkout-XXUndo All modifications to XX files in the workspace.
Git rm XXDelete XX files
Git remote add originHttps://github.com/tugenhua0707/testgit associates with a remote Library
Git push-u(You do not need to use-u for the first time)Origin masterPush the current master branch to the remote database
Git cloneHttps://github.com/tugenhua0707/testgit clone from remote Library
Git checkout-B devCreate a dev branch and switch to the dev branch.
Git branchView all current branches
Git checkout masterSwitch back to master Branch
Git merge devMerge dev branches on the current Branch
Git branch-d devDelete dev Branch
Git branch nameCreate Branch
Git stashHide the current job and resume the job after the job is resumed.
Git stash listView the list of all hidden files
Git stash applyRestore the hidden file, but the content is not deleted.
Git stash dropDelete an object
Git stash popRestore Files And delete files
Git remoteView remote database information
Git remote-vView remote database details
Git push origin masterGit pushes the master branch to the remote branch corresponding to the remote database.
The above is all the content of this article. I hope this article will help you in your study or work. I also hope to provide more support to the customer's home!