@@ -14,6 +14,7 @@ Though there are 1000’s of articles about git, I have written this article is
14
14
15
15
16
16
## Commands
17
+
17
18
### Configuration
18
19
19
20
git config that lets you get and set configuration variables that control all aspects of how Git looks and operates.
@@ -28,6 +29,7 @@ Though there are 1000’s of articles about git, I have written this article is
28
29
# Check
29
30
git config --global user.name
30
31
git config --global user.email
32
+
31
33
32
34
### Manage Repository
33
35
@@ -46,6 +48,7 @@ Though there are 1000’s of articles about git, I have written this article is
46
48
4- $ git commit -m "first commit"
47
49
5- $ git remote add origin github.com/saifaustcse/new_repository
48
50
6- $ git push -u origin master
51
+
49
52
50
53
### Adding files and folder (Workspace --> Staging)
51
54
@@ -73,6 +76,7 @@ Though there are 1000’s of articles about git, I have written this article is
73
76
74
77
# Display all diff information when submitting.
75
78
$ git commit -v
79
+
76
80
77
81
### Commit changes (Workspace --> Staging --> Repository)
78
82
@@ -82,6 +86,7 @@ Though there are 1000’s of articles about git, I have written this article is
82
86
# For untracked file
83
87
$ git add .
84
88
$ git commit -am [message]
89
+
85
90
86
91
### Undo Commit (Workspace <-- Staging <-- Repository )
87
92
@@ -110,11 +115,13 @@ Though there are 1000’s of articles about git, I have written this article is
110
115
111
116
# merge a branch into a target branch
112
117
$ git merge [source branch] [target branch]
118
+
113
119
114
120
### Workspace synchronization from remote (Workspace <-- Repository <-- Remote)
115
121
116
122
# Retrieve the changes to the Remote Repository and merge with the local branch (fetch+merge)
117
123
$ git pull origin [branch]
124
+
118
125
119
126
### Branching
120
127
@@ -145,6 +152,7 @@ Though there are 1000’s of articles about git, I have written this article is
145
152
# Delete the remote branch.
146
153
$ git push origin --delete [branch-name]
147
154
$ git branch -dr [remote/branch]
155
+
148
156
149
157
### Inspection
150
158
@@ -162,6 +170,7 @@ Though there are 1000’s of articles about git, I have written this article is
162
170
163
171
# Show the latest commits of the current branch.
164
172
$ git reflog
173
+
165
174
166
175
### Ignore files and folder
167
176
@@ -170,6 +179,7 @@ Though there are 1000’s of articles about git, I have written this article is
170
179
171
180
# Stop tracking the specified file, but the file will be remained in the Workspace.
172
181
$ git rm --cached [file]
182
+
173
183
174
184
### Tag
175
185
@@ -243,6 +253,7 @@ Though there are 1000’s of articles about git, I have written this article is
243
253
244
254
# Generate a archive for releasing.
245
255
$ git archive
256
+
246
257
247
258
# References
248
259
0 commit comments