Git common management commands
This article contains git commands that are often used in project development
- git init — initialize a local empty warehouse
- git status — View the status of local files, whether they have been managed by git
- git add. —Add all changed files to the local warehouse
- git commit -m "create project" — submit the changed files to the local warehouse and add the comment "create project"
- git branch origin — create a git branch of origin
- git branch-view the current branch
- git checkout master - switch to the master branch
- git checkout -b v1.0.1-Create a git branch of v1.0.1 and switch to this branch
- git remote add origin https://github.com/ze/project.git add remote warehouse alias origin for local warehouse
- git push -u origin master —/Submit the local warehouse to the master branch of the remote warehouse (origin)
- git clone https://github.com/ze/project.git --depth=1 --clone the latest version of git code