Create a git repository
git init # initialize
git add readme.md # to add a new file
git commit -am "some description"
git remote add origin [remote address] # Add distal warehouse address
git push -u origin master # submitted to the distal
Creating a branch
git branch newbranch # create a branch in the local
git checkout newbranch # to switch to the new branch
git push origin newbranch # new branch will submit to the distal
git branch -d newbranch # delete the local branch
git psuh origin: newbranch # delete remote branch, on behalf of the colon before branching deleted
Operation remote branch
git branch -a # see which remote branch there
git branch -a # see which remote branch there, and it displays the last commit information
git push origin --delete [remote branch name] # delete the specified remote branch
Version rollback
git log # commit log display, showing not so pretty
git log --pretty = oneline # view the commit log, showing in a row, more beautiful
git reset --hard [commit id] # View Submitted by git log history to determine if you want to return to the location, and want to get back to the execution of the commit id
reflog git # View all git command can be used to look before the rollback commit id in use git reset --hard roll back the past