git hit the patch process

You can view the play command history records

For example, I have to 3f3f5a2721301c47099b21691ae865b6cacbea97 this submission before 7 + 8 = submission submission, it would generate 8 patch

git format-patch   3f3f5a2721301c47099b21691ae865b6cacbea97 -8 

-8 expressed several times to submit records

Are 1.patch 2.patch ....... until 8.patch the file name is automatically generated based on the name given me just give an example

Then input to the current project directory

git am catalog /8.patch

 

There is also a patch is installed:

patch <xxxx.path -p1

patch <xxxx.path -p1 --dry-run 

on behalf of --dry-run attempt to patch software does not really modify the software. Can be added from time to increase

At this point just patch file changes to take effect, but also a lack of information and commit change id

So we can not push to the server

 

Then git log 

git commit --amend

 

Opens a file, and automatically change id add cmmit information to a file.

ctrl + X to exit the Edit File

Log in to see you can see change id

Then you can push to the server

 

 

 

 

Other finishing command git

git pull pulling code from the server

Prerequisite is to git status is not all read the papers submitted by state

If you do not submit to commit

Look log log git log --pretty = oneline --graph --decorate --all

Empty submit local cache synchronized with the remote

git  reset --hard origin/master

 

 

Solve problems playing patch failed:

First look at the state of git status

Then delete the file suffix orig

rm $(find . -name "*.orig")

 Then merge code manually rej

Then rm $ (find. -Name "* .rej") co-End

Rej deleted files

git add .

git status 

git diff --cached > ../t.patch

For example, some files do not need to submit the reset

git reset the file name

Then git commit -m "commit log"

git push origin HEAD:xxx/xxx/xxx

 

 

Published 137 original articles · won praise 29 · views 110 000 +

Guess you like

Origin blog.csdn.net/xiexiaotian11/article/details/105051544