Ask Your Question
2

GitHub fetch latest source code to your forked repository

asked 2013-08-01 08:16:13 -0600

I have added a pull request that was merged with openCV master about including link in docs for each cpp sample out there. I was planning on doing the same, but I am facing something I haven't encountered before with pull requests.

For the first set of requests I have pushed, I had made a fork in my own GitHub, then create a branch for each pull request that I wanted to make. But what I see now is that my merged fixes are not in my fork on GitHub.

However, if I pull directly the 2.4 branch source code from the Itseez github link then I do get the changes.

Is there any way of updating my master and 2.4 branch for my current fork or do I need to take a new fork if I want to continue adding stuff to the Itseez fork?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
4

answered 2013-08-01 08:38:47 -0600

berak gravatar image

"my merged fixes are not in my fork on GitHub."

that's right. it is not done automatically.

"do I need to take a new fork ? "

no,no, better update your local repo to the state on itseez.org, work on it and push again:

first switch to the original branch ( hope you left it clean, did not change anything there .. )

git checkout master ( or 2.4, whatever you want to update )

then get the current version from itseez:

git pull upstream master

or

git pull upstream 2.4

then

git branch new_project
git checkout new_project
... work on it, commit
git push new_project
edit flag offensive delete link more

Comments

Thanks that worked perfecty! Did have to create the upstream but it works good now :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-01 08:47:02 -0600 )edit
2

@Daniil Osokin: I am guessing this information should be added to the GitHub guide one the dev forum. This is kind of an essential thing.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-02 02:12:50 -0600 )edit

@StevenPuttemans Yes, we can do it, but it should be the instruction for TortoiseGit. Steven, please, can you help again?

Daniil Osokin gravatar imageDaniil Osokin ( 2013-08-05 04:15:00 -0600 )edit
1

Actually I will do it, but for these kinds of commands I use the GIT bash client, which is a shell when instlaling git and tortoisegit, because it is faster. I will have a look later at it to see if tortoiseGIT has an interface like this.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-05 07:25:31 -0600 )edit

I have looked into the interface for this in tortoiseGIT, but I suggest adding this as a git bash, which can also be called in Windows, since it seems to be way more complex doing this in TortoiseSVM

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-06 04:40:33 -0600 )edit
3

answered 2013-08-06 05:07:36 -0600

@Daniil Osokin: here you go

WINDOWS : FETCHING THE LATEST UPDATES AFTER YOUR PULL REQUEST GETS MERGED

Note: when creating a fork to the github repository, you fork it as it is on that moment. However, when adding pull requests, on a later moment, you might want to add changes to merged stuff. Then you notice all of a sudden your fork doesn't contain the updates. This guide show you how to make sure you have the latest version on your fork before starting a new bugfix.

STEP 1 : create a upstream remote (the actual opencv repository) on your local machine

  • Go to your openCV folder that is linked with your TortoiseGIT/GIT client.
  • Open the GIT bash client (which is way less complicated than the TortoiseGIT interface for this.

image description

  • If your GIT doesn't start up on the master branch, make sure to type in the command

image description

  • Create the upstream connection to be able to retrieve all changes

image description

STEP 2 : retrieve the latest changes locally

  • Retrieving the changes of the remote master to your local master branch is easy by the following command

image description

  • Identical for the 2.4 branch of the remote to your local 2.4 branch. Do not forget to first checkout to the 2.4 branch, else this will screw up your master :)

image description

STEP 3 : push the changes to your GitHub fork

  • Close down the git bash client. Updating is identical to pushing changes of a bugfix.
  • Right click on the folder and select push from TortoiseGIT interface.

image description

  • Make sure to select the push all branches. Press OK.

image description

  • Output will tell you that update of master and 2.4 branch was successful.

image description

edit flag offensive delete link more

Comments

1

Steven, thanks a lot!

Daniil Osokin gravatar imageDaniil Osokin ( 2013-08-07 02:49:12 -0600 )edit
1

You are welcome! Hopefully it helps others to make good pull requests :) We can use all the help there is :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-07 02:52:54 -0600 )edit

Maybe, it would be interesting to add this as an extra page, and put it at the beginning of your first page pipeline. With the notice I have added in italic or something similar.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-07 02:54:18 -0600 )edit
1

Yes, I'll do something like this, again thanks :).

Daniil Osokin gravatar imageDaniil Osokin ( 2013-08-07 05:27:52 -0600 )edit
1

Its nice to know that a little effort of everyone, keeps the work going :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-07 06:00:25 -0600 )edit
1

@StevenPuttemans Steven, updated guide (http://code.opencv.org/projects/opencv/wiki/Windows_7_and_TortoiseGit_contribution_guide). I've added contents, so, this section can be easily seen and accessed.

Daniil Osokin gravatar imageDaniil Osokin ( 2013-08-11 08:47:04 -0600 )edit

Very nice :) !

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-11 09:08:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-01 08:16:13 -0600

Seen: 1,206 times

Last updated: Aug 06 '13