Skip to content

Commit 9148567

Browse files
authored
docs: Added Push and Pull with local resources command in git (Pradumnasaraf#20)
1 parent 81e7812 commit 9148567

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

Git/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Git is free and open source software for distributed version control. Official [website](https://git-scm.com/)
22

3-
## Resources
3+
## Online Resources
44

55
- [learngitbranching.js.org](https://learngitbranching.js.org/)
66
- [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+
```

Git/commands/README.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@
4242
git cherry-pick <commit-hash> <commit-hash>
4343
```
4444

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+
4565
## **Clone**
4666

4767
- Existing repo into a new directory
@@ -220,6 +240,26 @@
220240
git commit --amend --date="YYYY-MM-DD HH:MM:SS
221241
```
222242
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+
223263
## **Rebase**
224264
225265
- An origin branch into working branch
@@ -290,11 +330,11 @@
290330
git reset --hard <repo>/<branch>
291331
```
292332
293-
- Remove/reset all the commits
333+
- Remove/reset all commits
294334
295-
```bash
296-
git update-ref -d HEAD
297-
```
335+
```bash
336+
git update-ref -d HEAD
337+
```
298338
299339
## **Squash**
300340

0 commit comments

Comments
 (0)