File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments