Organize your git tutorials from Liaoche
To create an empty directory:
mkdir Learngit
Turn the catalog into a warehouse
$ git init
Add files to the warehouse
$ git Add readme.txt
Submit the file to the warehouse
" wrote a readme file "
View historical records
$ git log
Git version fallback, in Git, to represent the HEAD current version, the previous version is, the last version HEAD^ is, HEAD^^ of course, 100 to 100 of the version is ^ more easy to count, so write HEAD~100 . Fallback version with reset
$ git reset--hard head^
git add remote repository
$ git Remote add origin [email protected]:liuhan703/xxx.git
Push local content to GitHub
$ Git push-u Origin Master
Cloning from a remote repository to a local
$ git clone [email protected]:michaelliao/gitskills.git
Create, switch branches
$ git checkout-b dev
There are two things done in the above sentence, creating a branch, switching to a branch
$ git branch dev$ git checkout dev
Merging branches to master
$ git Merge dev
Git common Command collation