Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MySetup
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TongZuu
MySetup
Commits
526e362d
Commit
526e362d
authored
Jul 03, 2018
by
TongZuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update git-command.md
parent
93b0c959
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
2 deletions
+82
-2
git-command.md
git-command.md
+82
-2
No files found.
git-command.md
View file @
526e362d
## 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
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment