Commit 526e362d by TongZuu

Update git-command.md

parent 93b0c959
## Git Command
\ No newline at end of file
## Git Command
#### create file .gitignore
```
touch .gitignore
```
#### initial git
```
git init
```
#### link git server
```
git remote add origin http://10.1.1.60/Support/3K.git
```
#### pull data from git server
```
git pull origin master
```
#### add to index stages All
```
git add -A
```
#### add to index stages new and modified, without deleted
```
git add .
```
#### add to index stages modified and deleted, without new
```
git add -u
```
#### set default user
```
git config --global user.email "support_myhr@csc.co.th"
git config --global user.name "support_myhr"
```
#### commit with message
```
git commit -m initial
```
#### commit with user
```
git -c user.name='Paul Draper' -c user.email='my@email.org' commit -m '...'
```
#### other
````
git config --global credential.helper 'cache --timeout=3600'
```
---
#### new branch from master. modify success
```
git format-patch --stdout master > my.patch
```
#### patch diff commit between n..n1
```
git format-patch --stdout bb25e649fcbc539d99945600c262636621b48a3f..a427ce27eee37982312b7d7b8f2600c406109f20 > my.patch
```
#### zip file ที่มีความแตกต่าง ระหว่าง commit ce1f8df - 8a22bd8
```
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