• Agenda
  • Support Points
  • Planet
  • Chat
  • Forum
  • Wiki
Ubuntu-be
  • Willkommen
  • Ubuntu anschaffen
  • Unterstützung
  • Mitmachen
  • Ziele
  • Hol dir dein Ubuntu-be Shirt
  • Kontakt

Login

Diese Webseite nutzt Launchpad für die Benutzerauthentifizierung.

Wenn Sie noch keinen Launchpad-Account haben, bekommen Sie beim ersten Login die Möglichkeit, einen Account anzulegen.

Wenn Sie vor der Launchpad-Integration einen Account auf unserer Seite hatten, müssen Sie sich manuell einloggen und die Launchpad-OpenID-Identität in Ihrem Account hinzufügen.

Every Ubunteros blogging or publishing anything more or less related to Ubuntu, FOSS and Linux from Belgium is invited to join the Planet. To add your feed(s) to the Planet you should first register at Launchpad and join the Ubuntu-be.org Planet Team. Once accepted as a member of the team you will be able to add your feed(s) under the Planet Feeds section of your account page. If necessary, make sure to register a filtered feed to avoid filling the Planet with unrelated content.

Social Networks

  • When: Sat, 02 Feb. 2013 09:00 - Sun, 03 Feb. 2013 18:00 +0000
    | Description: FOSDEM is a free event offering open source communities a place to meet, share ideas and collaborate. It is renowned for being highly developer-oriented and brings together 5000+ geeks from all over the world.

    Ubuntu has a booth here.

  • woutervddn (Wouter Vandenneucker)

    #ubuntube meeting is over.. glad some people showed up after all.. :o this workyear is gonna be awesome!

  • woutervddn (Wouter Vandenneucker)

    where the fuck is everybody? #ubuntube

  • MartijnCielen (Martijn Cielen)

    @Gunirus ik ken @woutervddn louter virtueel #ubuntuBE

  • MissyKel (MissyKel)

    Installeer de nieuwe versie van Ubuntu Linux op je computer op 6 mei - http://t.co/dOTgRM8F #ubuntube

Weiter

Solar System

  • Bloguntu (feed)
  • B² - de blog (ubuntu) (feed)
  • Mark Van den Borre (feed)
  • Serge van Ginderachter (feed)
  • Stani (feed)

Spachen

  • Nederlands
  • English
  • Français
  • Deutsch

Planet Ubuntu-be.org

Bild von svg

Serge van Ginderachter

Git and Github: keeping a feature branch updated with upstream?

Git and github, you gotta love them for managing and contributing to (FLOSS) projects.

Contributing to a Github hosted project becomes very easy. Fork the project to your personal Github account, clone your fork locally, create a feature branch, make some patch, commit, push back to your personal Github account, and issue a pull request from your feature branch to the upstream (master) branch.


git clone -o svg git@github.com:sergevanginderachter/ansible.git
cd ansible
git remote add upstream git://github.com/ansible/ansible.git
git checkout -b user-non-unique
vi library/user
git add library user
git commit -m "Add nonunique option to user module, translating to the -o/--non-unique option to useradd and usermod."
git push --set-upstream svg user-non-unique
[go to github and issue the pull request]

Now, imagine upstream (1) doesn’t approve your commit and asks for a further tweak and (2) you need to pull in newer changes (upstream changes that were committed after you created your feature branch.)

How do we keep this feature branch up to date? Merging the newest upstream commits is easy, but you want to avoid creating a merge commit, as that won’t be appreciated when pushed to upstream: you are then effectively re-committing upstream changes, and those upstream commits will get a new hash (as they get a new parent). This is especially important, as those merged commits would be reflected in your Github pull request when you push those updates to your personal github feature branch (even if you do that after you issued the pull request.)

That’s why we need to rebase instead of merging:


git co devel #devel is ansible's HEAD aka "master" branch
git pull --rebase upstream devel
git co user-non-unique
git rebase devel

Both the rebase option and rebase command to git will keep your tree clean, and avoid having merge commits.
But keep in mind that those areyour first commits (with whom you issued your first pull request) that are being rebased, and which now have a new commit hash, which is different from the original hashes that are still in your remote github repo branch.

Now, pushing those updates out to your personal Github feature branch will fail here, as both branches differ: the local branch tree and the remote branch tree are “out of sync”, because of those different commit hashes. Git will tell you to first git pull --rebase, then push again, but this won’t be a simple fast-forward push, as your history got rewritten. Don’t do that!

The problem here is that you would again fetch your first changed commits as they were originally, and those will get merged on top of your local branch. Because of the out of sync state, this pull does not apply cleanly. You’ll get a b0rken history where your commits appear two times. When you would push all of this to your github feature branch, those changes will get reflected on the original pull request, which will get very, very ugly.

AFAIK, there is actually no totally clean solution to this. The best solution I found is to force push your local branch to your github branch (actually forcing a non-fast-orward update):

As per git-push(1):

Update the origin repository’s remote branch with local branch, allowing non-fast-forward updates. This can leave unreferenced commits dangling in the origin repository.

So don’t pull, just force push like this:

git push svg +user-non-unique

This will actually plainly overwrite your remote branch, with everything in your local branch. The commits which are in the remote stream (and caused the failure) will remain there, but will be dangling commit, which would eventually get deleted by git-gc(1). No big deal.

As I said, this is AFAICS the cleanest solution. The downside of this, is that your PR will be updated with those newest commits, which will get a later date, and could appear out of sync in the comment history of the PR. No big problem, but could potentially be confusing.

April 07, 2013 6:18 PM

Bild von markvdb

Mark Van den Borre

Ingesneeuwd

Vorige week rond deze tijd voorbereidingen voor een barbecue.

Vandaag auto helpen uitgraven uit sneeuwduin van een goeie halve meter.

März 12, 2013 12:49 PM

© Copyright 2008-2011 Ubuntu-be.org