Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

3. Updating your fork from original repo to keep up with their changes:

git pull upstream master
@CristinaSolana

This comment has been minimized.

Show comment
Hide comment
@CristinaSolana

CristinaSolana Feb 22, 2012

I use 'master' in the example for pulling from the original repo, but you could pull from any branch.

Owner

CristinaSolana commented Feb 22, 2012

I use 'master' in the example for pulling from the original repo, but you could pull from any branch.

@metude

This comment has been minimized.

Show comment
Hide comment
@metude

metude Nov 8, 2012

I tried this but it didn't updated my repo in github.com? So how can I send them to github.com? (I'm a bit new.)

metude commented Nov 8, 2012

I tried this but it didn't updated my repo in github.com? So how can I send them to github.com? (I'm a bit new.)

@jjt

This comment has been minimized.

Show comment
Hide comment
@jjt

jjt Dec 12, 2012

@metude You've just updated your local repo and need to push your changes:

git push

jjt commented Dec 12, 2012

@metude You've just updated your local repo and need to push your changes:

git push
@bertomartin

This comment has been minimized.

Show comment
Hide comment
@bertomartin

bertomartin Oct 29, 2013

What happens if the branch you wanna pull from was created after you forked the original repo? If you're on the 'master' branch of your repo, can you do: git pull upstream new-upstream-branch?

bertomartin commented Oct 29, 2013

What happens if the branch you wanna pull from was created after you forked the original repo? If you're on the 'master' branch of your repo, can you do: git pull upstream new-upstream-branch?

@ncrash

This comment has been minimized.

Show comment
Hide comment
@ncrash

ncrash May 7, 2014

Thanks!!

ncrash commented May 7, 2014

Thanks!!

@vlad-light

This comment has been minimized.

Show comment
Hide comment
@vlad-light

vlad-light Oct 27, 2014

Is it still Up-To-Date? In my forked repo i see the message "This branch is 2 commits behind avalanche123:develop" so I tried to follow your instructions to get all last changes from original repo, but everytime I execute git pull upstream develop I get a message:

From https://github.com/avalanche123/Imagine
 * branch            develop    -> FETCH_HEAD
Already up-to-date.

Do I miss something ?!

vlad-light commented Oct 27, 2014

Is it still Up-To-Date? In my forked repo i see the message "This branch is 2 commits behind avalanche123:develop" so I tried to follow your instructions to get all last changes from original repo, but everytime I execute git pull upstream develop I get a message:

From https://github.com/avalanche123/Imagine
 * branch            develop    -> FETCH_HEAD
Already up-to-date.

Do I miss something ?!

@sudoer

This comment has been minimized.

Show comment
Hide comment
@sudoer

sudoer Feb 16, 2015

Thanks for sharing! I'm learning by doing.

sudoer commented Feb 16, 2015

Thanks for sharing! I'm learning by doing.

@timmaybrown

This comment has been minimized.

Show comment
Hide comment
@timmaybrown

timmaybrown Jun 26, 2015

Thank you so much!

timmaybrown commented Jun 26, 2015

Thank you so much!

@mtjhax

This comment has been minimized.

Show comment
Hide comment
@mtjhax

mtjhax Jul 13, 2015

Part of official docs now: https://help.github.com/articles/syncing-a-fork/ (note that their example uses rebase instead of pull to get changes from upstream -- depends on your preference)

mtjhax commented Jul 13, 2015

Part of official docs now: https://help.github.com/articles/syncing-a-fork/ (note that their example uses rebase instead of pull to get changes from upstream -- depends on your preference)

@SkyzohKey

This comment has been minimized.

Show comment
Hide comment
@SkyzohKey

SkyzohKey Apr 2, 2016

Thanks. Saved my day. :3

SkyzohKey commented Apr 2, 2016

Thanks. Saved my day. :3

@NitroBAY

This comment has been minimized.

Show comment
Hide comment
@NitroBAY

NitroBAY commented Apr 8, 2016

Thanks

@wolf99

This comment has been minimized.

Show comment
Hide comment
@wolf99

wolf99 May 12, 2016

Awesome, thanks!

wolf99 commented May 12, 2016

Awesome, thanks!

@vis4573

This comment has been minimized.

Show comment
Hide comment
@vis4573

vis4573 Jun 1, 2016

Thank You !

vis4573 commented Jun 1, 2016

Thank You !

@NexusInk

This comment has been minimized.

Show comment
Hide comment
@NexusInk

NexusInk Jun 24, 2016

Git also does this via 'sync' on Desktop.

NexusInk commented Jun 24, 2016

Git also does this via 'sync' on Desktop.

@evrpg

This comment has been minimized.

Show comment
Hide comment
@evrpg

evrpg Sep 10, 2016

Thank you working just fine.

evrpg commented Sep 10, 2016

Thank you working just fine.

@zbyna

This comment has been minimized.

Show comment
Hide comment
@zbyna

zbyna Sep 17, 2016

Thanks, I got it finally πŸ˜ƒ

zbyna commented Sep 17, 2016

Thanks, I got it finally πŸ˜ƒ

@andreasblueher

This comment has been minimized.

Show comment
Hide comment
@andreasblueher

andreasblueher Oct 12, 2016

Thank you very much! πŸ‘

andreasblueher commented Oct 12, 2016

Thank you very much! πŸ‘

@xCyborg

This comment has been minimized.

Show comment
Hide comment
@xCyborg

xCyborg Oct 14, 2016

Can you do that from the website?

xCyborg commented Oct 14, 2016

Can you do that from the website?

@robincher

This comment has been minimized.

Show comment
Hide comment
@robincher

robincher Dec 12, 2016

Thanks for the help! It's working right here

robincher commented Dec 12, 2016

Thanks for the help! It's working right here

@mamakancha

This comment has been minimized.

Show comment
Hide comment
@mamakancha

mamakancha Dec 15, 2016

Thanks. Helped me a lot :)

mamakancha commented Dec 15, 2016

Thanks. Helped me a lot :)

@isabellerichard

This comment has been minimized.

Show comment
Hide comment
@isabellerichard

isabellerichard commented Jan 13, 2017

Top πŸ‘

@conorbmurphy

This comment has been minimized.

Show comment
Hide comment
@conorbmurphy

conorbmurphy Jan 17, 2017

This is the clearest solution I've seen--thank you!

conorbmurphy commented Jan 17, 2017

This is the clearest solution I've seen--thank you!

@AdrianAntunez

This comment has been minimized.

Show comment
Hide comment
@AdrianAntunez

AdrianAntunez Jan 24, 2017

Thank you so much! That detailed explanation makes the process a peace of cake

AdrianAntunez commented Jan 24, 2017

Thank you so much! That detailed explanation makes the process a peace of cake

@mitchellkrogza

This comment has been minimized.

Show comment
Hide comment
@mitchellkrogza

mitchellkrogza Jan 28, 2017

works like a charm, thank you

mitchellkrogza commented Jan 28, 2017

works like a charm, thank you

@lucapierobon

This comment has been minimized.

Show comment
Hide comment
@lucapierobon

lucapierobon Feb 5, 2017

that's exactly what I was looking for! thanks a lot!

lucapierobon commented Feb 5, 2017

that's exactly what I was looking for! thanks a lot!

@MajesticFalcon

This comment has been minimized.

Show comment
Hide comment
@MajesticFalcon

MajesticFalcon commented Feb 6, 2017

Thank you

@mmccool

This comment has been minimized.

Show comment
Hide comment
@mmccool

mmccool Feb 14, 2017

Thanks a lot! I really wish there was a way to do this from the website, though.

mmccool commented Feb 14, 2017

Thanks a lot! I really wish there was a way to do this from the website, though.

@karthik972

This comment has been minimized.

Show comment
Hide comment
@karthik972

karthik972 Mar 6, 2017

Isn't "git rebase upstream/master" is better option than "git pull upstream master" ? This will work properly even if the current branch has few commits extra than in the upstream master.

karthik972 commented Mar 6, 2017

Isn't "git rebase upstream/master" is better option than "git pull upstream master" ? This will work properly even if the current branch has few commits extra than in the upstream master.

@4leem

This comment has been minimized.

Show comment
Hide comment
@4leem

4leem Mar 23, 2017

Thanks! Work like a charm

4leem commented Mar 23, 2017

Thanks! Work like a charm

@OtacilioN

This comment has been minimized.

Show comment
Hide comment
@OtacilioN

OtacilioN Mar 25, 2017

Thank you so much!

OtacilioN commented Mar 25, 2017

Thank you so much!

@qct

This comment has been minimized.

Show comment
Hide comment
@qct

qct Apr 1, 2017

origin has 1 branch, but upstream has 3 branches, how to sync origin with upstream?

qct commented Apr 1, 2017

origin has 1 branch, but upstream has 3 branches, how to sync origin with upstream?

@pierx

This comment has been minimized.

Show comment
Hide comment
@pierx

pierx commented Apr 27, 2017

Thanks

@blachawk

This comment has been minimized.

Show comment
Hide comment
@blachawk

blachawk commented May 10, 2017

Thanks!

@mohamessi

This comment has been minimized.

Show comment
Hide comment
@mohamessi

mohamessi May 11, 2017

Thanks you very mutch.

mohamessi commented May 11, 2017

Thanks you very mutch.

@david-sackstein

This comment has been minimized.

Show comment
Hide comment
@david-sackstein

david-sackstein May 20, 2017

I followed the instructions in the documentation and also received this:
From https://github.com/

  • branch develop -> FETCH_HEAD
    Already up-to-date.
    My history as in git log has not changed and I have no uncommitted changes.
    Why do I not see a merge commit?

david-sackstein commented May 20, 2017

I followed the instructions in the documentation and also received this:
From https://github.com/

  • branch develop -> FETCH_HEAD
    Already up-to-date.
    My history as in git log has not changed and I have no uncommitted changes.
    Why do I not see a merge commit?
@qazqwezxc

This comment has been minimized.

Show comment
Hide comment
@qazqwezxc

qazqwezxc May 21, 2017

Awesome, worked as intended.

Thanks!

qazqwezxc commented May 21, 2017

Awesome, worked as intended.

Thanks!

@duncombe

This comment has been minimized.

Show comment
Hide comment
@duncombe

duncombe Jun 5, 2017

These comments all seem to depend on cloning the repo to your local computer and doing the fetch and merge there followed by a push. You can perform the sync to the upstream repo directly on github. Generate a pull request at the upstream repo (there is a link "compare forks") specifying your fork as the base and the upstream branch you want to merge as the head. Generate the pull request and if all goes well, you can accept your PR and you do not have to fetch both to your local site. The merge is done directly on github.

duncombe commented Jun 5, 2017

These comments all seem to depend on cloning the repo to your local computer and doing the fetch and merge there followed by a push. You can perform the sync to the upstream repo directly on github. Generate a pull request at the upstream repo (there is a link "compare forks") specifying your fork as the base and the upstream branch you want to merge as the head. Generate the pull request and if all goes well, you can accept your PR and you do not have to fetch both to your local site. The merge is done directly on github.

@Pradhvan

This comment has been minimized.

Show comment
Hide comment
@Pradhvan

Pradhvan commented Jun 12, 2017

Thanks !

@leamtrop

This comment has been minimized.

Show comment
Hide comment
@leamtrop

leamtrop commented Jun 28, 2017

Thanks!

@jfeng10

This comment has been minimized.

Show comment
Hide comment
@jfeng10

jfeng10 Jul 4, 2017

Great! It saves me a lot of time. Thank you! :)

jfeng10 commented Jul 4, 2017

Great! It saves me a lot of time. Thank you! :)

@chathuralakmal

This comment has been minimized.

Show comment
Hide comment
@chathuralakmal

chathuralakmal commented Jul 5, 2017

Thanks.

@jishnujayakumar

This comment has been minimized.

Show comment
Hide comment
@jishnujayakumar

jishnujayakumar Jul 12, 2017

Great. Helped me a lot. Thank you! :)

jishnujayakumar commented Jul 12, 2017

Great. Helped me a lot. Thank you! :)

@azzamsa

This comment has been minimized.

Show comment
Hide comment
@azzamsa

azzamsa Jul 19, 2017

Great! It saves my day. Thank you! :)
have a nice day!.

azzamsa commented Jul 19, 2017

Great! It saves my day. Thank you! :)
have a nice day!.

@tuhinsharma

This comment has been minimized.

Show comment
Hide comment
@tuhinsharma

tuhinsharma Jul 19, 2017

Works fine!! Thanks!!

tuhinsharma commented Jul 19, 2017

Works fine!! Thanks!!

@pepa65

This comment has been minimized.

Show comment
Hide comment
@pepa65

pepa65 Jul 23, 2017

I think the final step in the given recipe should be:
git push
Without it, the remote part of your fork will still not be up-to-date. Right??

pepa65 commented Jul 23, 2017

I think the final step in the given recipe should be:
git push
Without it, the remote part of your fork will still not be up-to-date. Right??

@caioleonhardt

This comment has been minimized.

Show comment
Hide comment
@caioleonhardt

caioleonhardt commented Aug 1, 2017

Thanks.

@charisTheo

This comment has been minimized.

Show comment
Hide comment
@charisTheo

charisTheo Aug 2, 2017

Thank you so much!!

charisTheo commented Aug 2, 2017

Thank you so much!!

@weitzhandler

This comment has been minimized.

Show comment
Hide comment
@weitzhandler

weitzhandler Aug 6, 2017

Thanks for sharing.
Would love to see this in the Visual Studio interface.

weitzhandler commented Aug 6, 2017

Thanks for sharing.
Would love to see this in the Visual Studio interface.

@DavidMS

This comment has been minimized.

Show comment
Hide comment
@DavidMS

DavidMS Aug 7, 2017

This didn't worked for me, the github repo still not up to date. And when i merged with master it didn't found any changes. Thankx anyway.

DavidMS commented Aug 7, 2017

This didn't worked for me, the github repo still not up to date. And when i merged with master it didn't found any changes. Thankx anyway.

@DavidMS

This comment has been minimized.

Show comment
Hide comment
@DavidMS

DavidMS Aug 7, 2017

Fixed! I had my project connected to the origin instead of my github's repository in Visual Studio. I changed and it worked! I now can do it from Visual Studio with no command line arguments need.

DavidMS commented Aug 7, 2017

Fixed! I had my project connected to the origin instead of my github's repository in Visual Studio. I changed and it worked! I now can do it from Visual Studio with no command line arguments need.

@MounirHamani

This comment has been minimized.

Show comment
Hide comment
@MounirHamani

MounirHamani commented Aug 19, 2017

Thank you @duncombe.

@arzola

This comment has been minimized.

Show comment
Hide comment
@arzola

arzola Aug 22, 2017

If you don't have SSH access you can go with https πŸ‘

git remote add upstream https://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

arzola commented Aug 22, 2017

If you don't have SSH access you can go with https πŸ‘

git remote add upstream https://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

@nitin1706

This comment has been minimized.

Show comment
Hide comment
@nitin1706

nitin1706 Aug 22, 2017

Thanks. It helped.

nitin1706 commented Aug 22, 2017

Thanks. It helped.

@rujesh

This comment has been minimized.

Show comment
Hide comment
@rujesh

rujesh Aug 30, 2017

Great. Also, thank you @duncombe for your different approach.

rujesh commented Aug 30, 2017

Great. Also, thank you @duncombe for your different approach.

@ludoo0d0a

This comment has been minimized.

Show comment
Hide comment
@ludoo0d0a

ludoo0d0a Sep 4, 2017

Thanks ! Solved my problem and it helps me to understand better branching concept ;) !

ludoo0d0a commented Sep 4, 2017

Thanks ! Solved my problem and it helps me to understand better branching concept ;) !

@petzi53

This comment has been minimized.

Show comment
Hide comment
@petzi53

petzi53 Sep 6, 2017

Another thank you!! I googled this problem and found very different and much more complicated solutions. Besides those solutions have used 'rebase' e.g. have rewritten history. Your solution is simple - so that even I as a newbie to Git and Github can understand it. And: It works!

petzi53 commented Sep 6, 2017

Another thank you!! I googled this problem and found very different and much more complicated solutions. Besides those solutions have used 'rebase' e.g. have rewritten history. Your solution is simple - so that even I as a newbie to Git and Github can understand it. And: It works!

@successgdc

This comment has been minimized.

Show comment
Hide comment
@successgdc

successgdc Sep 21, 2017

I just want to say THANKS to you. I am new to make my little contribution to some awesome open source projects, and it solved my problem, much thanks.

successgdc commented Sep 21, 2017

I just want to say THANKS to you. I am new to make my little contribution to some awesome open source projects, and it solved my problem, much thanks.

@qm3ster

This comment has been minimized.

Show comment
Hide comment
@qm3ster

qm3ster Sep 21, 2017

@vlad-light did you push to your repository after this?

qm3ster commented Sep 21, 2017

@vlad-light did you push to your repository after this?

@robiXxu

This comment has been minimized.

Show comment
Hide comment
@robiXxu

robiXxu Sep 25, 2017

Thank you!

robiXxu commented Sep 25, 2017

Thank you!

@franfacchini

This comment has been minimized.

Show comment
Hide comment
@franfacchini

franfacchini commented Oct 11, 2017

Tks!

@arvchristos

This comment has been minimized.

Show comment
Hide comment
@arvchristos

arvchristos Oct 13, 2017

This is great and simple. Thanks a lot

arvchristos commented Oct 13, 2017

This is great and simple. Thanks a lot

@EthraZa

This comment has been minimized.

Show comment
Hide comment
@EthraZa

EthraZa Oct 18, 2017

Make my day

EthraZa commented Oct 18, 2017

Make my day

@buoyantair

This comment has been minimized.

Show comment
Hide comment
@buoyantair

buoyantair Oct 21, 2017

This was helpful!

buoyantair commented Oct 21, 2017

This was helpful!

@SuperOP535

This comment has been minimized.

Show comment
Hide comment
@SuperOP535

SuperOP535 commented Oct 21, 2017

Thanks

@dhirajpatra

This comment has been minimized.

Show comment
Hide comment
@dhirajpatra

dhirajpatra Oct 23, 2017

Better to use : git pull --rebase upstream master [for clean repo history] after add and fetch remote.

Regards

dhirajpatra commented Oct 23, 2017

Better to use : git pull --rebase upstream master [for clean repo history] after add and fetch remote.

Regards

@mikeyc7m

This comment has been minimized.

Show comment
Hide comment
@mikeyc7m

mikeyc7m Oct 30, 2017

can this be done via the github website interface, rather than downloading the whole repository to a local?

mikeyc7m commented Oct 30, 2017

can this be done via the github website interface, rather than downloading the whole repository to a local?

@hemangshah

This comment has been minimized.

Show comment
Hide comment
@hemangshah

hemangshah Oct 31, 2017

Can someone tell how to do it with Github Desktop app for Mac?

hemangshah commented Oct 31, 2017

Can someone tell how to do it with Github Desktop app for Mac?

@ewoks

This comment has been minimized.

Show comment
Hide comment
@ewoks

ewoks Nov 1, 2017

Guess I can't make PR for gist,no @CristinaSolana ? If not here is my teeny-tiny suggestion
https://gist.github.com/ewoks/63a4153577bdf58a69ba3a7c1f3ccdfb

ewoks commented Nov 1, 2017

Guess I can't make PR for gist,no @CristinaSolana ? If not here is my teeny-tiny suggestion
https://gist.github.com/ewoks/63a4153577bdf58a69ba3a7c1f3ccdfb

@salah-mohammed

This comment has been minimized.

Show comment
Hide comment
@salah-mohammed

salah-mohammed Nov 14, 2017

how install forked as pod when add to my project

salah-mohammed commented Nov 14, 2017

how install forked as pod when add to my project

@meg7mal

This comment has been minimized.

Show comment
Hide comment
@meg7mal

meg7mal Nov 22, 2017

This is great thanks! In addition, I had to merge the upstream branch I was tracking to the equivalent branch in my local fork repo which @grabcode helped with by linking to https://help.github.com/articles/syncing-a-fork/

meg7mal commented Nov 22, 2017

This is great thanks! In addition, I had to merge the upstream branch I was tracking to the equivalent branch in my local fork repo which @grabcode helped with by linking to https://help.github.com/articles/syncing-a-fork/

@mabelvj

This comment has been minimized.

Show comment
Hide comment
@mabelvj

mabelvj Dec 1, 2017

Great! Quite useful! Thanks!

mabelvj commented Dec 1, 2017

Great! Quite useful! Thanks!

@WarenGonzaga

This comment has been minimized.

Show comment
Hide comment
@WarenGonzaga

WarenGonzaga Dec 1, 2017

Thanks for this!

WarenGonzaga commented Dec 1, 2017

Thanks for this!

@sergeyguzhev

This comment has been minimized.

Show comment
Hide comment
@sergeyguzhev

sergeyguzhev Dec 15, 2017

Thank you, Cristina!

sergeyguzhev commented Dec 15, 2017

Thank you, Cristina!

@Zibri

This comment has been minimized.

Show comment
Hide comment
@Zibri

Zibri Dec 29, 2017

is it possible to do it from the website directly?

Zibri commented Dec 29, 2017

is it possible to do it from the website directly?

@CCS86

This comment has been minimized.

Show comment
Hide comment
@CCS86

CCS86 Dec 30, 2017

I'm wondering the same thing.

Also, what about selectively accepting/rejecting changes from the master to your fork?

CCS86 commented Dec 30, 2017

I'm wondering the same thing.

Also, what about selectively accepting/rejecting changes from the master to your fork?

@Rhialto

This comment has been minimized.

Show comment
Hide comment
@Rhialto

Rhialto Jan 1, 2018

Does this work for all branches, or only for master (I suspect this because master is mentioned in the command)?
What if I made a fresh branch to keep my changes on? (This seems to be recommended, I read somewhere). In this case all original upstream branches should simply fast-forward and only on my own changes branch there would be merges.

Rhialto commented Jan 1, 2018

Does this work for all branches, or only for master (I suspect this because master is mentioned in the command)?
What if I made a fresh branch to keep my changes on? (This seems to be recommended, I read somewhere). In this case all original upstream branches should simply fast-forward and only on my own changes branch there would be merges.

@YuRaNnNzZZ

This comment has been minimized.

Show comment
Hide comment
@YuRaNnNzZZ

YuRaNnNzZZ commented Jan 2, 2018

Thanks!

@ThatsGobbles

This comment has been minimized.

Show comment
Hide comment
@ThatsGobbles

ThatsGobbles Jan 19, 2018

Thank you Cristina, this was both very helpful and short and sweet. Much appreciated!

ThatsGobbles commented Jan 19, 2018

Thank you Cristina, this was both very helpful and short and sweet. Much appreciated!

@rakeshhny

This comment has been minimized.

Show comment
Hide comment
@rakeshhny

rakeshhny Jan 22, 2018

In our organization we use Atlassian Stash Software for managing remote repositories.

We fork the upstream repository and keep the forked repository in auto-sync with upstream repository so that all approved/valid changes into upstream repository will automatically flow to all the forked repository.

With this I do not have to manually update my forked remote repository.

All I have to do is just pull latest from forked master into local master.

Is there a way on github to achieve the same?

rakeshhny commented Jan 22, 2018

In our organization we use Atlassian Stash Software for managing remote repositories.

We fork the upstream repository and keep the forked repository in auto-sync with upstream repository so that all approved/valid changes into upstream repository will automatically flow to all the forked repository.

With this I do not have to manually update my forked remote repository.

All I have to do is just pull latest from forked master into local master.

Is there a way on github to achieve the same?

@Eugene-Y

This comment has been minimized.

Show comment
Hide comment
@Eugene-Y

Eugene-Y Jan 26, 2018

thanks a bunch :)

Eugene-Y commented Jan 26, 2018

thanks a bunch :)

@bartlettpsj

This comment has been minimized.

Show comment
Hide comment
@bartlettpsj

bartlettpsj Jan 31, 2018

Rakeshhny - there a fork syncing feature of github or GitLab enterprise, but not for gitlab community edition.

My company moved from stash to gitlab community and ever since I’ve missed that feature. Management was so much simpler.

Also the gitlab fork syncing feature isn’t as good as stash as it only does it every hour but I recall stash was immediate.

Just remember to pull from upstream before starting a new branch in your fork.

bartlettpsj commented Jan 31, 2018

Rakeshhny - there a fork syncing feature of github or GitLab enterprise, but not for gitlab community edition.

My company moved from stash to gitlab community and ever since I’ve missed that feature. Management was so much simpler.

Also the gitlab fork syncing feature isn’t as good as stash as it only does it every hour but I recall stash was immediate.

Just remember to pull from upstream before starting a new branch in your fork.

@gowthamkaruturi

This comment has been minimized.

Show comment
Hide comment
@gowthamkaruturi

gowthamkaruturi Feb 5, 2018

thanks a lot .

gowthamkaruturi commented Feb 5, 2018

thanks a lot .

@sankar6

This comment has been minimized.

Show comment
Hide comment
@sankar6

sankar6 commented Feb 6, 2018

thanks

@CDawg

This comment has been minimized.

Show comment
Hide comment
@CDawg

CDawg Feb 15, 2018

There are no responses to people still having an issue with this NOT working. There is definitely a clear bug that people are having following all the guides.
My forked local branch is NOT reflecting the original master. github says this master is 86 commits behind master. When I choose Compare it says that there is nothing to compare.
I have followed: https://help.github.com/articles/configuring-a-remote-for-a-fork/
I have followed: https://help.github.com/articles/syncing-a-fork/
My local fork STILL says Already up to date. Yet clearly the Master branch is far beyond my local fork.

If all else fails, you will have to "rebase" or delete your local repo and fork the origin all over again.

CDawg commented Feb 15, 2018

There are no responses to people still having an issue with this NOT working. There is definitely a clear bug that people are having following all the guides.
My forked local branch is NOT reflecting the original master. github says this master is 86 commits behind master. When I choose Compare it says that there is nothing to compare.
I have followed: https://help.github.com/articles/configuring-a-remote-for-a-fork/
I have followed: https://help.github.com/articles/syncing-a-fork/
My local fork STILL says Already up to date. Yet clearly the Master branch is far beyond my local fork.

If all else fails, you will have to "rebase" or delete your local repo and fork the origin all over again.

@jeffreylec

This comment has been minimized.

Show comment
Hide comment
@jeffreylec

jeffreylec commented Feb 16, 2018

thanks!

@CaDs

This comment has been minimized.

Show comment
Hide comment
@CaDs

CaDs Mar 3, 2018

thanks a lot

CaDs commented Mar 3, 2018

thanks a lot

@pursonchen

This comment has been minimized.

Show comment
Hide comment
@pursonchen

pursonchen Mar 4, 2018

You can use my shell script to synchronize, welcome everyone to correct. https://github.com/pursonchen/sync-fork.git

pursonchen commented Mar 4, 2018

You can use my shell script to synchronize, welcome everyone to correct. https://github.com/pursonchen/sync-fork.git

@pharzath

This comment has been minimized.

Show comment
Hide comment
@pharzath

pharzath commented Mar 14, 2018

thanks

@emi-silva

This comment has been minimized.

Show comment
Hide comment
@emi-silva

emi-silva commented Mar 14, 2018

thanks

@aliradd

This comment has been minimized.

Show comment
Hide comment
@aliradd

aliradd Mar 15, 2018

Have I misunderstood something? is it not much easier to use the following:
https://help.github.com/articles/configuring-a-remote-for-a-fork/
thanks.

aliradd commented Mar 15, 2018

Have I misunderstood something? is it not much easier to use the following:
https://help.github.com/articles/configuring-a-remote-for-a-fork/
thanks.

@fernandesGabriel

This comment has been minimized.

Show comment
Hide comment
@fernandesGabriel

fernandesGabriel commented Mar 16, 2018

Thanks a lot

@GarnetSunset

This comment has been minimized.

Show comment
Hide comment
@GarnetSunset

GarnetSunset Mar 20, 2018

Just dropping a big old thanks here :)

GarnetSunset commented Mar 20, 2018

Just dropping a big old thanks here :)

@xeniorac

This comment has been minimized.

Show comment
Hide comment
@xeniorac

xeniorac Apr 2, 2018

Thanks a ton for saving!

xeniorac commented Apr 2, 2018

Thanks a ton for saving!

@RatnadeepBiswakarma

This comment has been minimized.

Show comment
Hide comment
@RatnadeepBiswakarma

RatnadeepBiswakarma Apr 3, 2018

I have forked a repository and I want to update my fork with the original repository how to do that?

RatnadeepBiswakarma commented Apr 3, 2018

I have forked a repository and I want to update my fork with the original repository how to do that?

@yangbodong22011

This comment has been minimized.

Show comment
Hide comment
@yangbodong22011

yangbodong22011 Apr 6, 2018

@RatnadeepBiswakarma

git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git rebase upstream master

yangbodong22011 commented Apr 6, 2018

@RatnadeepBiswakarma

git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git rebase upstream master
@yanshengjia

This comment has been minimized.

Show comment
Hide comment
@yanshengjia

yanshengjia commented Apr 8, 2018

Thanks!

@Fogetti

This comment has been minimized.

Show comment
Hide comment
@Fogetti

Fogetti Apr 8, 2018

Cool thanks!

Fogetti commented Apr 8, 2018

Cool thanks!

@geloumil

This comment has been minimized.

Show comment
Hide comment
@geloumil

geloumil commented Apr 14, 2018

thanks :)

@t151848p

This comment has been minimized.

Show comment
Hide comment
@t151848p

t151848p commented Apr 22, 2018

Danke!

@sonyakc

This comment has been minimized.

Show comment
Hide comment
@sonyakc

sonyakc May 2, 2018

Awesome this is great. Thank you!

sonyakc commented May 2, 2018

Awesome this is great. Thank you!

@otherpirate

This comment has been minimized.

Show comment
Hide comment
@otherpirate

otherpirate commented May 4, 2018

Thanks!

@arisliang

This comment has been minimized.

Show comment
Hide comment
@arisliang

arisliang May 8, 2018

I find this is easier to grasp than the github documentation. Just remember to push after the pull, which should probably be the step 4 of the gist.

arisliang commented May 8, 2018

I find this is easier to grasp than the github documentation. Just remember to push after the pull, which should probably be the step 4 of the gist.

@spik3s

This comment has been minimized.

Show comment
Hide comment
@spik3s

spik3s May 28, 2018

That was so easy. Thanks!

spik3s commented May 28, 2018

That was so easy. Thanks!

@timoteoponce

This comment has been minimized.

Show comment
Hide comment
@timoteoponce

timoteoponce Jun 1, 2018

Still very useful, thanks @CristinaSolana!!

timoteoponce commented Jun 1, 2018

Still very useful, thanks @CristinaSolana!!

@lixzhang

This comment has been minimized.

Show comment
Hide comment
@lixzhang

lixzhang commented Jun 1, 2018

Thanks!

@omidnasri

This comment has been minimized.

Show comment
Hide comment
@omidnasri

omidnasri Jun 2, 2018

That was so easy. Thanks.

omidnasri commented Jun 2, 2018

That was so easy. Thanks.

@danielmbicalho

This comment has been minimized.

Show comment
Hide comment
@danielmbicalho

danielmbicalho Jun 21, 2018

Easy. Thank you

danielmbicalho commented Jun 21, 2018

Easy. Thank you

@Dhiraj240

This comment has been minimized.

Show comment
Hide comment
@Dhiraj240

Dhiraj240 Jun 22, 2018

Thank You.It made my day.

Dhiraj240 commented Jun 22, 2018

Thank You.It made my day.

@sonfack

This comment has been minimized.

Show comment
Hide comment
@sonfack

sonfack Jun 24, 2018

Thanks very much. it works !

sonfack commented Jun 24, 2018

Thanks very much. it works !

@seleregb

This comment has been minimized.

Show comment
Hide comment
@seleregb

seleregb Jul 4, 2018

works like a charm :)

seleregb commented Jul 4, 2018

works like a charm :)

@komputronika

This comment has been minimized.

Show comment
Hide comment
@komputronika

komputronika commented Jul 6, 2018

Thanks!

@edufonseca

This comment has been minimized.

Show comment
Hide comment
@edufonseca

edufonseca commented Jul 9, 2018

awesome!

@alexivkin

This comment has been minimized.

Show comment
Hide comment
@alexivkin

alexivkin Jul 10, 2018

I built a web based solution to sync the fork with the original using only GitHub APIs. It's all web, you don't need to do anything on the client
https://forkrefresh.herokuapp.com
As a plus it tells you the status off all your repos as compared to sources of the forks.

alexivkin commented Jul 10, 2018

I built a web based solution to sync the fork with the original using only GitHub APIs. It's all web, you don't need to do anything on the client
https://forkrefresh.herokuapp.com
As a plus it tells you the status off all your repos as compared to sources of the forks.

@brunobc182

This comment has been minimized.

Show comment
Hide comment
@brunobc182

brunobc182 Jul 13, 2018

Thanks for share! πŸ‘

brunobc182 commented Jul 13, 2018

Thanks for share! πŸ‘

@mleszcz

This comment has been minimized.

Show comment
Hide comment
@mleszcz

mleszcz commented Jul 17, 2018

πŸ‘

@MartinVNavarro

This comment has been minimized.

Show comment
Hide comment
@MartinVNavarro

MartinVNavarro Jul 17, 2018

So easy to follow, thank you so much πŸ‘

MartinVNavarro commented Jul 17, 2018

So easy to follow, thank you so much πŸ‘

@aparnap08

This comment has been minimized.

Show comment
Hide comment
@aparnap08

aparnap08 Jul 18, 2018

Thanks for making this so simple. πŸ‘

aparnap08 commented Jul 18, 2018

Thanks for making this so simple. πŸ‘

@muriithiderro

This comment has been minimized.

Show comment
Hide comment
@muriithiderro

muriithiderro Jul 19, 2018

I realized that the merges happened but the branches from the original repository were not updated, run this bash script code to update the branches.

for branch in $(git ls-remote --heads upstream|sed 's#^.*refs/heads/##'); do git push origin refs/remotes/upstream/$branch:refs/heads/$branch; done

muriithiderro commented Jul 19, 2018

I realized that the merges happened but the branches from the original repository were not updated, run this bash script code to update the branches.

for branch in $(git ls-remote --heads upstream|sed 's#^.*refs/heads/##'); do git push origin refs/remotes/upstream/$branch:refs/heads/$branch; done

@CristinaSolana

This comment has been minimized.

Show comment
Hide comment
@CristinaSolana

CristinaSolana Jul 30, 2018

Glad this has helped everyone. Somehow I missed all the comments until now. :)

Owner

CristinaSolana commented Jul 30, 2018

Glad this has helped everyone. Somehow I missed all the comments until now. :)

@terrysky718

This comment has been minimized.

Show comment
Hide comment
@terrysky718

terrysky718 Aug 5, 2018

This is brilliant and immensely helpful! Thanks so much indeed.

terrysky718 commented Aug 5, 2018

This is brilliant and immensely helpful! Thanks so much indeed.

@thiagoaugusto

This comment has been minimized.

Show comment
Hide comment
@thiagoaugusto

thiagoaugusto Aug 15, 2018

Thanks, Cristina! Helped me a lot.

thiagoaugusto commented Aug 15, 2018

Thanks, Cristina! Helped me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment