Common git commands in brick 3

Source: Internet
Author: User
Tags git commands

Common git commands

Find a good summary blog, please refer to: http://blog.csdn.net/ariesjzj/article/details/7747876

Git Add: tracks new files, stores tracked files in the temporary storage area, and marks conflicting files as resolved during merge.
Git status: Check the current file status
Git DIFF: compare the difference between the current file in the working directory and the snapshot in the temporary storage area, that is, the changed content has not been saved yet.
Git diff -- cached: compare the difference between the files that have been saved and the snapshot that was last submitted.
Git commit: Submit the-M parameter followed by the submission instructions
Git log: view submission history-P option to show differences in content submitted each time, use-2 to show only the last two updates; -- stat to show only brief statistics on the number of added and modified rows
Git reset head <File>: cancels saved files.
Git checkout -- <File>: cancels modification to the file.
Git remote add [shortname] [url]: Add a remote Repository
Git fetch [Remote-name]: captures data from a remote warehouse to a local device.
Git push [Remote-name] [branch-name]: pushes data from the local repository to the remote repository. Example: git push origin master
Git remote show [Remote-name]: View Details of a remote Repository
Git remote RM: remove the corresponding remote Repository
Git config: Set the alias for the command, for example, git config -- Global alias.br branch.
Git branch branch_name
Git branch: list all branches without adding any parameters
Git checkout branch_name: only the branch to which the head is converted
Git checkout-B branch_name: new branch, head pointer, and switch to this branch
Git branch-D branch_name: delete Branch
Git fetch origin for synchronization.
Git push (remote_name) (branch_name): pushes my branch_name local branch to the -- branch of the remote repository.
Git push [remote name]: [branch name]: delete remote Branch
Git pull: Execute two operations. It captures the modified content from the remote branch and then merges it into the current branch.

Xiaohua Xiaoxiao-The song can still be sung in the summer

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.