File tree 2 files changed +53
-5
lines changed
2 files changed +53
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Git is free and open source software for distributed version control. Official [ website] ( https://git-scm.com/ )
2
2
3
- ## Resources
3
+ ## Online Resources
4
4
5
5
- [ learngitbranching.js.org] ( https://learngitbranching.js.org/ )
6
6
- [ gitexplorer.com] ( https://gitexplorer.com/ )
7
+
8
+ ## Local Resources
9
+
10
+ - Use ` --help ` option with any command to get to know how to use the command:
11
+
12
+ ``` bash
13
+ git push --help
14
+ ```
Original file line number Diff line number Diff line change 42
42
git cherry-pick < commit-hash> < commit-hash>
43
43
```
44
44
45
+ ## ** Push**
46
+
47
+ - Push chnages to remote repo
48
+
49
+ ``` bash
50
+ git push < remote> < branch>
51
+ ```
52
+
53
+ - force the push even if it results in a non-fast-forward merge
54
+
55
+ ``` bash
56
+ git push < remote> --force # Use the flag in case you know what you’re doing.
57
+ ```
58
+
59
+ - Push all of your local branches to the specified remote.
60
+
61
+ ``` bash
62
+ git push < remote> --all
63
+ ```
64
+
45
65
## ** Clone**
46
66
47
67
- Existing repo into a new directory
220
240
git commit --amend --date=" YYYY-MM-DD HH:MM:SS
221
241
` ` `
222
242
243
+ # # **Pull**
244
+
245
+ - Pull the specified remote’s copy of the current branch and merge it into local
246
+
247
+ ` ` ` bash
248
+ git pull <remote>
249
+ ` ` `
250
+
251
+ - Gives output during a pull (displays the pulled content and the merge details)
252
+
253
+ ` ` ` bash
254
+ git pull --verbose
255
+ ` ` `
256
+
257
+ - Pull changes and prevent merge conflicts
258
+
259
+ ` ` ` bash
260
+ git pull --ff-only # applies the remote changes only if they can be fast-forwarded
261
+ ` ` `
262
+
223
263
# # **Rebase**
224
264
225
265
- An origin branch into working branch
290
330
git reset --hard <repo>/<branch>
291
331
` ` `
292
332
293
- - Remove/reset all the commits
333
+ - Remove/reset all commits
294
334
295
- ` ` ` bash
296
- git update-ref -d HEAD
297
- ` ` `
335
+ ` ` ` bash
336
+ git update-ref -d HEAD
337
+ ` ` `
298
338
299
339
# # **Squash**
300
340
You can’t perform that action at this time.
0 commit comments