-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-commands
76 lines (58 loc) · 1.18 KB
/
git-commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
git init
git config --global user.name "Polarapu Prasad"
git config --global user.email "devopstraining2015@gmail.com"
git config --list
Paheses:
1) Workspace
2) Staging / Index
3) Local repo
touch file1
ls
git status
git add file1
git status
git commit -m "label" file1
git status
git log
git show cid
touch file2 file3 file4 file5
git status
git add file2 file4
or
git add *
or
git add .
or
git add -A
git status
git commit -m "label"
git reset --soft cid (local to staging)
git reset HEAD file-name (staging to workspace)
git reset --mixed cid (local to workspace)
git commit -m "label" file (workspace to local *only modiified files)
git clone https://github.com/polarapu/batch59.git
ls
cd batch59
touch prasad
git status
git add .
git commit -m "label" prasad
git push
BRANCH
-----------
git branch
git branch branch-name
git branch
git checkout branch-name
git merge branch-name (all changes)
git cherry-pick cid (only one commit)
git push origin branch-name
or
git push path/of/c-repo branch-name
git branch -d branch-name (local)
git push origin -d branch-name (central)
git branch
git branch -r
git checkout -b origin/branch
git checkout -b origin/branch
git branch