How git submits processing in various situations

Source: Internet
Author: User

Self-Summary: 01. If there is a conflict in the commit process, after resolving the conflict, git Add. git rebase-continuegit push for 02.git rebase vs git mergegit rebase b (Merge branch B) resolve the conflict Git rebase-continuegit rebase-skip//skip conflict git rebase-absort//Cancel merge  1, develop git in dev branch Add. Git commit-am "git pull-reba SE//Conflict resolution GIT push Origin dev:refs/for/dev 2, Offline Test 1) mvn debug on Jetty2) curl-h "* * *: * * * * * *: * * *"   "htt p://***/***/***?***=***&***=*** '  3, if you want to return to git log after commit//See which commitid you need to go back to, git reset commitidgit push   git Add.  git commit git push almost completely cancels all of the previous changes  4, if Git reset-hard commitid back to where it was last changed, git Pull pulls the last change down again git revert commitidgit commit git push git revert  is to generate a new commit to undo a commit, The commit before this commit will be retained Git reset  is back to a commit, commit and previous commit will be retained, but the subsequent changes will be returned to staging area   Online collection of useful examples: A) rollback add manipulation   reference $ edit                                      (1)  $ git add frotz.c filfre.c $ mailx                                       (2)  $ git reset                                   (3)  $ git pull Git://info.example.com/nitfol    (4)  b) rollback last commit  reference $ git commit ...  $ git reset--soft head^        (1)  $ edit                          (2)  $ git commit-a-C orig_head   (3)   C) Roll back the last commit and put these commits on the branch called topic.   Reference $ git branch topic/wip     (1)  $ git reset--hard head~3   (2)   d) Permanently delete last few commit  references $ git commit ...  $ git reset-- Hard head~3   (1)  e) rollback merge and Pull operations   reference $ git pull                          (1)  auto-merging nitfol conflict (content): Merge CONFLICT in nitfol automatic merge failed; Fix conflicts and then commit the result. $ git reset--hard                  (2)  $ git pull. topic/branch           (3)  updating from 41223 ... To 13134... fast-forward $ git reset--hard orig_head       (4)  F) Roll back the merge or pull  reference $ git in the contaminated working tree pull                          (1)  auto-merging Nitfol merge made by recursive. nitfol                 |   20 +++++ ---- ... $ git reset--merge orig_head       (2)  g) interrupted workflow   This is often the case in real-world development: You're developing a big feature, and there's an urgent bug to fix, but the current content in working tree hasn't been formed yet, and it's not enough to commit, but you have to switch the other branch to fix Bug Take a look at the following example   reference $ git checkout feature; # were working in "feature" branch and $ work work work   & nbsp;  ; # got interrupted $ git commit-a-M "Snapshot WIP"        & nbsp;         (1)  $ git checkout master $ fix fix fix $ git commit; # commit with real log $ git checkout feature $ git reset--soft head^; # go back to WIP State &nbs p; (2)  $ git reset                                        (3)   (H) reset a separate file   Suppose you've added a file to index, but then you're not going to commit the file, you can use git reset to remove the file from index.   Reference $ git reset--frotz.c                        (1)  $ git commit-m "commit files in index"       (2)  $ git add frotz.c                            (3)   (I) reserved working Tree and discard some of the previous commit  assume that you are editing some files and have submitted them, and then continue to work, but now you find that the current content in the working tree should belong to another branch, which has nothing to do with the previous commit. At this point, you can open a new branch and keep the contents of the working tree.   Reference $ git tag start $ git checkout-b branch1 $ edit $ git commit ...      &nb sp;                        (1)  $ edit $ git checkout-b branch2                    (2)  $ git reset--keep start                      (3)  

Git submits processing in various situations

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.