Skip to content

Commit 332f642

Browse files
all situations req
1 parent 2df2e48 commit 332f642

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,33 @@ git remote set-url origin <new git url>
8080

8181
```
8282

83-
## Update forked Repository with original Repository
83+
## Update forked Repository with original Repository :hourglass:
84+
85+
These steps are to be followed when your forked repository is few commits behind original repository
86+
87+
```sh
88+
89+
- Add original repository url here
90+
91+
git remote add upstream https://github.com/whoever/whatever.git
92+
93+
- Fetch all branches of the repository
94+
95+
git fetch upstream
96+
97+
- Make sure you are on master branch
98+
99+
git checkout master
100+
101+
- Rewrite your master branch so that any commits of yours that aren not already in upstream/master are replayed on top of that other branch
102+
103+
git rebase upstream/master
104+
105+
This should update your forked repository with original repository
106+
107+
However if you do not want to rewrite history of master branch then replace last command with this
108+
109+
git merge upstream/master
110+
111+
```
84112

0 commit comments

Comments
 (0)