I'm trying to emulate in git what subversion users would think of as a vendor branch. In my case, I'm using a patched version of Drupal, which is available via git. So I'm thinking the right thing to do is a git repository with multiple remotes, as described in Merging two remote repositories in Git
I'd like to pull from drupal.org git repo a version of Drupal, and commit it to my own git repo where I will apply patches. So I clone my repo and add drupal.org as another remote, like so.
git clone myrepo:drupal/core
git remote add drupal.org http://git.drupal.org/project/drupal.git
git checkout -b custom-7.x drupal.org/7.x
git pull drupal.org 7.30
I believe my problem comes from that last line. It is pulling a tagged version of drupal 7.x which is not the same as the tip of the branch.
Next, I try to push drupal 7.30 into my repository, and here's where it fails.
git push -n origin
...
! [rejected] custom-7.x -> custom-7.x (non-fast-forward)
error: failed to push some refs to 'git.electricgroups:drupal/core'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
It's ironic that git provides 4 lines of hint, yet I still don't have a clue.
Can git be used to manage my patched version of Drupal? Is there a better way to set it up? If not, how do I get past this error?