Commit 2ff138f1 by TongZuu

Update git-command.md

parent d12cc22e
## Git Command # Git Command
#### create file .gitignore #### create file .gitignore
``` ```
...@@ -55,10 +55,29 @@ git -c user.name='Paul Draper' -c user.email='my@email.org' commit -m '...' ...@@ -55,10 +55,29 @@ git -c user.name='Paul Draper' -c user.email='my@email.org' commit -m '...'
git config --global credential.helper 'cache --timeout=3600' git config --global credential.helper 'cache --timeout=3600'
``` ```
---
## Git patch and apply
# Git patch and apply
#### create patch from tag to current
format : git format-patch {{from_tag}} --stdout > {{path_to_patch_file}}
```
git format-patch v1 --stdout > ../v2.patch
```
#### apply patch to project
format : git apply {{path_to_patch_file}}
```
git apply my.patch
```
# Other
#### new branch from master. modify success #### new branch from master. modify success
``` ```
...@@ -77,9 +96,6 @@ git format-patch --stdout bb25e649fcbc539d99945600c262636621b48a3f..a427ce27eee3 ...@@ -77,9 +96,6 @@ git format-patch --stdout bb25e649fcbc539d99945600c262636621b48a3f..a427ce27eee3
git archive -o update.zip HEAD $(git diff ce1f8df 8a22bd8 --name-only) git archive -o update.zip HEAD $(git diff ce1f8df 8a22bd8 --name-only)
``` ```
#### apply patch to project
```
git apply my.patch
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment