From: Alfredo Palhares <masterkorp@masterkorp.net>
To: git <git@vger.kernel.org>
Subject: Strange behauviour on Cherry-Pick
Date: Fri, 09 Mar 2012 15:11:54 +0100 [thread overview]
Message-ID: <1331296972-sup-5028@masterkorp.net> (raw)
Hello,
I have a repository[1] with my home files that i keep track off on my machines.
Until now ive been having everything in the same branch across all the computers,
but now i have a machine that requires diferences on some files.
So what i did i branched out and keep control the commits i want to the other branch
trough cherry-picking.
So there's how i did it.
Create the new branch
$ git checkout -b boobierack
Start by removing files i dont need in this machine (one of the reasons i will not merge this branch)
$ git rm files
$ git commit -m "remove files"
Now editing things i only need here
$ vim file
$ git commit -m "Edit file to feature X work in this machine"
Now i have some sweet weechat configs in this machine i want to committ
$ git add .weecchat/conffiles
$ git commit -m "Add swet weechat configs"
I also added tmux
...
Now i added some sup config files i only need in this branch
$ git add .sup/whateves
$ git commit -m "Add sup configs"
Push branch up
$ git push origin boobierack
On another computer:
I wanted that tmux config but i didn't want to merge the branch, so i cherry picked the commit
(Maybe this is not the best way to this use case, if so i am open to sugestions, but keep reading
because i want to know why this is happening )
Since cherry pick gets the diff introduced by that commit, i think using it woulbe nice.
$ git pull origin
On branch master
$ git cherry-pick refspectotmuxcommit
Maybe those weechat config would be handy in another computers
$ git cherry-pick refscectoweechatconfigs
Pushed the commits
$ git push origin
Everything seemed ok both on master[2] and boobierack[3] branches
Back to the boobierack machine:
Pull the commits before adding more stuff
$ git pull origin
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 18 (delta 2), reused 18 (delta 2)
Unpacking objects: 100% (18/18), done.
From github.com:masterkorp/Home-files
* branch HEAD -> FETCH_HEAD
Merge made by recursive.
I got like... OK ?
On branh boobierack
$ git log --pretty=format:'''%h : %s''' --date-order --graph -n 6
* 4d7b2e8 : Merge github.com:masterkorp/Home-files into boobierack
|\
| * 9937a0a : Fancier tmux
* | 811355b : Add sup config files
* | 9de92a2 : Fancier tmux
| * aac85ac : Add weechat config files
* | 90a6162 : Add weechat config files
And master branch was untouched, i read on recursive merging on man page, but
i can't even understand why is git using that method in the first place, since
the hashes are diferent and git doesn't care about the diff when fetching iirc.
Any help would be deeply apreciated.
[1] https://github.com/masterkorp/Home-files
[2] https://github.com/masterkorp/Home-files/commits/master
[3] https://github.com/masterkorp/Home-files/commits/boobierack
--
Regards,
Alfredo Palhares
next reply other threads:[~2012-03-09 14:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 14:11 Alfredo Palhares [this message]
2012-03-09 17:20 ` Strange behauviour on Cherry-Pick Carlos Martín Nieto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331296972-sup-5028@masterkorp.net \
--to=masterkorp@masterkorp.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).