Ask Your Question
2

Help required in contributing code to opencv 3.4 branch

asked 2019-12-29 00:35:22 -0600

Gourav gravatar image

updated 2019-12-29 02:50:36 -0600

I want to contribute tutorial code to opencv repository
I forked and cloned the OpenCV repository I have added two files only and I want to create a pull request for the 3.4 branch I created a branch called "tutorial_4" for which I want to create the pull request.
When I select the branch as 3.4 for my pull request it shows 905 commits and 1829 files changed
image description
But when I do it for the master it shows only the two files that I have added image description
How to create a pull request without getting unnecessary commits in my pull request
Please answer in detail as I am a Github newbie.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-29 03:08:04 -0600

berak gravatar image

I forked and cloned the OpenCV repository

yea, ok. but that means, you're on the master branch locally, on your box now. before adding or changing anything, do:

git checkout 3.4   # switch from master to 3.4
git checkout -b my_new_commit   # make a new branch for your changes (with a nice name)

then add / change files, commit and

git push origin my_new_commit

(where "origin" is your forked opencv repo)

then change the base branch on the github page to 3.4, and you should be ok ;)

---------------------------------------------------------------------------------------------------

if you already are in the mess you show above (started from wrong branch), you will have to rebase it

git rebase -i --onto upstream/3.4 upstream/master

(check list of your commits, save and quit (Esc + ":wq" + Enter)

((and yea, oh my, getting out of bloody vim....))

and do a forced push:

git push -f origin my_new_commit

gl ;)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-12-29 00:35:22 -0600

Seen: 172 times

Last updated: Dec 29 '19