Basic commands for GIT operations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.