User Tools

Site Tools


work:git-guide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
work:git-guide [2016/11/04 16:55] percywork:git-guide [2018/02/05 19:15] (current) – [git checkout specified file from another branch] percy
Line 499: Line 499:
   git checkout branch_name -- path/to/file   git checkout branch_name -- path/to/file
      
 +==== git revert ====
  
 +github support revert the pull request, so after you have revert the pull request, and still want to merge the feature branch, then you need to find the revert commit id, and revert it again
 +
 +  git revert ce8731f5cbc55ab50723ee2a8ec615b462b3b0e6 -m 1
 +
 +So the full log will be like
 +<code>
 +commit 817947e37c5f835384fd282ab2004a6d9a848975 (HEAD -> pjq/testing, origin/pjq/testing)
 +Author: Jianqing Peng <Jianqing.Peng@sap.com>
 +Date:   Mon Feb 5 19:09:40 2018 +0800
 +
 +    Revert "Merge pull request #2087 from sfofficial/revert-2086-pjq/testing_new_feature"
 +    
 +    This reverts commit ce8731f5cbc55ab50723ee2a8ec615b462b3b0e6, reversing
 +    changes made to 67a513f686ec9c203b7d38a3df1abbe7079320d4.
 +
 +commit ce8731f5cbc55ab50723ee2a8ec615b462b3b0e6
 +Merge: 67a513f686 a157cdef4e
 +Author: Jianqing Peng <jianqing.peng@sap.com>
 +Date:   Mon Feb 5 19:07:33 2018 +0800
 +
 +    Merge pull request #2087 from sfofficial/revert-2086-pjq/testing_new_feature
 +    
 +    Revert "add new feature 1"
 +
 +commit a157cdef4e391981b2053b52f560a70464b2dd7f
 +Author: Jianqing Peng <jianqing.peng@sap.com>
 +Date:   Mon Feb 5 19:06:29 2018 +0800
 +
 +    Revert "add new feature 1"
 +
 +commit 67a513f686ec9c203b7d38a3df1abbe7079320d4
 +Merge: 08a5c9c33e a161eed1e3
 +Author: Jianqing Peng <jianqing.peng@sap.com>
 +Date:   Mon Feb 5 19:05:57 2018 +0800
 +
 +    Merge pull request #2086 from sfofficial/pjq/testing_new_feature
 +    
 +    add new feature 1
 +
 +commit a161eed1e3d200f6121690494dd6df1d065163fb (origin/pjq/testing_new_feature, pjq/testing_new_feature)
 +Author: Jianqing Peng <Jianqing.Peng@sap.com>
 +Date:   Mon Feb 5 19:05:11 2018 +0800
 +
 +    add new feature 1
 +
 +
 +</code>
/var/www/dokuwiki/wiki/data/attic/work/git-guide.1478249731.txt.gz · Last modified: 2016/11/04 16:55 by percy