The most common git commands

Source: Internet
Author: User
Tags commit reset using git git clone git commands
    git git status//View status changes: Change meaning; Commit: Commit state (save locally) git commit-a//commit all, turn all changes into commit

    Git commit-a-M "fill in the prompt statement you modified here"; This command can skip commit-a after the popup edit prompt statement editor gitk//graphical form git add d:////Add a file git commit-a--amend//Add this commit to the last commit git checkout-b issue88//Create and switch to Issue88 branch git branch//view Local  

    Branch git branch-a View all branches git checkout master//Switch to Master branch Git fetch origin issue88//download latest file from server side  git rebase issue88//merge latest files into local issue88 Git push origin issue88//upload local issue88 commit to server-side git pull Origin master//Download master latest files from server side to local git diff//compare current and staging area files git merge <branch>//Merge branch branch into current directory Branch git clone//download entire library from server to local git help <command>//display command with git checkout can discard local changes and use git pull to get serv

The latest update on ER.

For example, I want to discard all the changes to a file: Git checkout routes.js and then use git pull to get the version of the code on the server. Fallback to the last commit git reset head^ back to this pull, (undo thisPull) git reset--hard HEAD modifies the file on a branch today, and then it has been updated on the line, and I'm using git stash to save the modified file to the cache, checkout to master, and then I forget to switch to the previous Git stash pop, on the master git stash pop, the results conflict.

Needs merge error occurred while switching, then Google a bit ...

 There are conflicts that occur before the local conmmit, using git reset--mixed to release the conflict without affecting any previous changes


Related Article

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.