The recent project group uses GIT as a version control tool and summarizes the git versions of GIT commands used in the work.
In accordance with the general workflow, first you need to register a git account on the official website (https://github.com/) and install the Git software.
After the installation is successful, create a new directory, store the GIT project, and then right-click to see the following:
Choose Git Bash
1. Initialize git
git config--global user.name "xxx"
git config--global user.email "[Email protected]"
Set up a registered user name and mailbox
2. Copy the items on the GIT server
git clone [email protected]:wordpress.git (Project git address)
3, each need to update the content on the server pull command
Git pull
4. View local file status
git status
Status lists all files that need to be submitted for addition to the warehouse, as well as files that need to resolve conflicts
5. Add to local Warehouse
git add "file path" (the file path to add will be listed after status)
6, submit to the local warehouse
git commit-m "Modify comments"
7. Push to remote server
git push
If the commit fails, there may be someone that is already push and you need to pull down if there is a conflict after the conflict is resolved in the push
The above is a basic process.
8. View the log version
git log
9. View different
git diff log version filename path
10, local removal from the server above recovery
git checkout file name
11, delete the local add
git rm "File path"
Basic commands for GIT operations