------Create a library-------------------
1. Create a local repository
Git init
2. Add Files
git add fileName
3. Submit to Library
git commit-m "message"
------version control, modify-------------------
1. Workspace modification Fallback
Git checkout--fileName
2. Modified fallback for add to staging area
git reset HEAD fileName and then use checkout
3. Commit to Repository modification fallback
git log to look at the log, then git reset--hard head^ (or the specific ID of the version)
4. deleting files
git rm fileName
------Remote Repository-------------------
1. Create a remote repository and associate it locally
git remotes Add origin remote code base address/learngit.git
2. Push local files to remote
Git push-u Origin Master (-U represents the first time)
3. Cloning code on the remote
git clone [email protected]:michaelliao/gitskills.git
------Branch-------------------
1. Create, switch branches
Git branch Dev
git checkout Dev
2. Create + Toggle Branch
Git checkout-b <name>
3. View Branches
Git branch
4. Merging a branch to the current branch
git merge <name>
5. Delete a branch
Git branch-d <name>
------Other-------------------
1. View status
git status
2. View Changes
Git diff
3. View the change history
git log [--pretty=oneline]
4. View each command
Git reflog
5. View Files
Cat FileName
Git Common Command Collation