GitHub best practices
#1
Hi,

I succesfully made a personal Eden Build with some patches, but now I'd like to:
  • Create a Github repository
  • Keep it synchronized with xbmc/xbmc repository
  • Create an Eden+patches branch
  • Compile every day the last nightly, with my patches added.

So I tried the "fork" command in GitHub.
I now have a  mika91/xbmc, repository but it isn't synchronized with xbmc/xbmc. I don't have the last commits in master branch for example.
How can I achieve this?

And for compiling each day the last nighlty with my patches, what is the best way?

thanks
Reply
#2
You need to add the xbmc/xbmc repo as a remote repository (we call it "upstream") to your local git repo (there's a tutorial on github for that). Then you need to run "git fetch upstream" and in your master branch you need to run "git pull upstream master" to get the latest commits from xbmc/xbmc. Then you create a new branch based on your master branch and apply your patches. Everytime you want to synchronise your repository with xbmc/xbmc you need to run "git pull --rebase upstream master" to get the latest commits from xbmc/xbmc, apply them to your branch and re-apply all your patches on top of them. Then you can do your build.

Are these patches very "personal" or could they be useful for other people as well? In case of the latter feel free to create a pull request on github with your patches/changes.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
oh, thanks for the very quick answer!
I'm using only few patches found on the forum: DXVA HQ Scalers and PGS Forced Subtitles
I'm quite happy with both, and I'll check tonight if pull request are not already done for these.
Reply
#4
(2012-10-03, 15:35)mika91 Wrote: oh, thanks for the very quick answer!
I'm using only few patches found on the forum: DXVA HQ Scalers and PGS Forced Subtitles
I'm quite happy with both, and I'll check tonight if pull request are not already done for these.

If creating PR always do this in a branch of master. This way you can update master branch and rebase the working branches on top of that
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
(2012-10-03, 15:39)Martijn Wrote:
(2012-10-03, 15:35)mika91 Wrote: oh, thanks for the very quick answer!
I'm using only few patches found on the forum: DXVA HQ Scalers and PGS Forced Subtitles
I'm quite happy with both, and I'll check tonight if pull request are not already done for these.

If creating PR always do this in a branch of master. This way you can update master branch and rebase the working branches on top of that

I think I need to read a good tutorial/Ebook about GIT.
It seems very powerful but quite complicated...
Only using non-distributed repository at work (subversion and clearcase), ^^

Reply
#6
(2012-10-03, 15:43)mika91 Wrote:
(2012-10-03, 15:39)Martijn Wrote:
(2012-10-03, 15:35)mika91 Wrote: oh, thanks for the very quick answer!
I'm using only few patches found on the forum: DXVA HQ Scalers and PGS Forced Subtitles
I'm quite happy with both, and I'll check tonight if pull request are not already done for these.

If creating PR always do this in a branch of master. This way you can update master branch and rebase the working branches on top of that

I think I need to read a good tutorial/Ebook about GIT.
It seems very powerful but quite complicated...
Only using non-distributed repository at work (subversion and clearcase), ^^

I highly recommend SmartGIT (<- very very easy to use GUI for git)
http://www.syntevo.com/smartgit/index.html
It's free to use for non commercial use

On Github site there are very good how-to guides that read easy. I started that way myself just did it step by step.
Using SmartGIT makes life so much more easy.

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
ok.
I played with git and smartGit tonight.
Let's see what I have done:
  • recreated my xbmc/xbmc fork, named mika91/xbmc
  • Clone mika91/xbmc repository to a local one
  • Add remote repository xbmc/xbmc to local rep.

So now, If I want to keep my online repository synchronized, I have to pull xbmc/xbmc localy, then push to mika91/xbmc ?
Or there is a way without localy pull/push)?

For my workflow, I switch to xbmc/master branch, right?
Then I add my patches localy, and push all in a mika91/master+mypatch branch?
And every night, I will pull xbmc/master into my working branch, and then push it back into mika91/master+mypatch

I continue playing and learning Git Wink
Reply
#8
Start by reading the git parable:

http://tom.preston-werner.com/2009/05/19...rable.html

I'd highly recommend using git on the command line, so you get to know exactly how it works.

To maintain a patch branch you:

1. Branch off upstream/master and switch to it:

git branch patched_upstream upstream/master
git checkout patched_upstream

2. Apply your patches via git am, or via patch + git commit.

3. Build.

To update your patched branch to whatever new and shiny thing is in upstream/master your goal is to bring the unpatched bit of your branch up to date, but still have your patches applied on top of the result. This can be achieved by fetching the changes from upstream, then rebasing your branch onto the updated master from upstream so that your changes are top-most:

git fetch upstream
git rebase upstream/master

Alternatively this can be done via git pull --rebase upstream master

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
GitHub best practices0