Skip to content

Instantly share code, notes, and snippets.

@fujin
Forked from dysinger/*scratch*
Created April 14, 2010 05:18
Show Gist options
  • Save fujin/365478 to your computer and use it in GitHub Desktop.
Save fujin/365478 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Demo how your can merge opscode chef-repo & cookbooks
# and perm. keep up to date with opscode cookbooks (list line)
% git clone git://github.com/opscode/chef-repo.git
Initialized empty Git repository in /home/tim/src/chef-repo/.git/
remote: Counting objects: 107, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 107 (delta 45), reused 0 (delta 0)
Receiving objects: 100% (107/107), 16.14 KiB, done.
Resolving deltas: 100% (45/45), done.
% cd chef-repo
% git remote add -f cookbooks git://github.com/opscode/cookbooks.git
Updating cookbooks
warning: no common commits
remote: Counting objects: 6291, done.
remote: Compressing objects: 100% (1995/1995), done.
remote: Total 6291 (delta 3435), reused 6291 (delta 3435)
Receiving objects: 100% (6291/6291), 5.09 MiB | 937 KiB/s, done.
Resolving deltas: 100% (3435/3435), done.
From git://github.com/opscode/cookbooks
* [new branch] master -> cookbooks/master
% git merge -s ours --no-commit cookbooks/master
Automatic merge went well; stopped before committing as requested
% git read-tree --prefix=cookbooks -u cookbooks/master
% git commit -m 'Merged opscode cookbooks as our chef-repo cookbooks'
[master e0f92d9] Merged opscode cookbooks as our chef-repo cookbooks
% git pull -s subtree cookbooks master
From git://github.com/opscode/cookbooks
* branch master -> FETCH_HEAD
Already up-to-date.
% # ROK!
AJ-Christensens-MacBook ~/Development
61 Development % rm -rf chef-repo 2010-04-14 17:30:32 aj ttys003
AJ-Christensens-MacBook ~/Development
62 Development % git clone git://github.com/opscode/chef-repo.git 2010-04-14 17:30:34 aj ttys003
Initialized empty Git repository in /Users/aj/Development/chef-repo/.git/
remote: Counting objects: 107, done.
remote: Compressing objects: 100% (99/99), done.
remote: Total 107 (delta 45), reused 0 (delta 0)
Receiving objects: 100% (107/107), 16.14 KiB, done.
Resolving deltas: 100% (45/45), done.
AJ-Christensens-MacBook ~/Development
63 Development % cd chef-repo 2010-04-14 17:30:45 aj ttys003
AJ-Christensens-MacBook ~/Development/chef-repo on master(709a15e) tracking origin/master
64 chef-repo:master % git remote add -f cookbooks git://github.com/opscode/cookbooks.git 2010-04-14 17:30:48 aj ttys003
Updating cookbooks
warning: no common commits
remote: Counting objects: 6291, done.
remote: Compressing objects: 100% (1995/1995), done.
remote: Total 6291 (delta 3435), reused 6291 (delta 3435)
Receiving objects: 100% (6291/6291), 5.09 MiB | 676 KiB/s, done.
Resolving deltas: 100% (3435/3435), done.
From git://github.com/opscode/cookbooks
* [new branch] master -> cookbooks/master
AJ-Christensens-MacBook ~/Development/chef-repo on master(709a15e) tracking origin/master
65 chef-repo:master % git merge -s ours --no-commit cookbooks/master 2010-04-14 17:31:01 aj ttys003
Automatic merge went well; stopped before committing as requested
AJ-Christensens-MacBook ~/Development/chef-repo on master(709a15e) tracking origin/master
66 chef-repo:master % git read-tree --prefix=cookbooks -u cookbooks/master 2010-04-14 17:31:08 aj ttys003
AJ-Christensens-MacBook ~/Development/chef-repo on master(709a15e) tracking origin/master
67 chef-repo:master+ % git commit -m "subtree setup" 2010-04-14 17:31:20 aj ttys003
[master ae44d19] subtree setup
AJ-Christensens-MacBook ~/Development/chef-repo on master(ae44d19) 765 commits since (ae44d19) tracking origin/master(709a15e)
68 chef-repo:master % git pull -s subtree cookbooks master 2010-04-14 17:31:25 aj ttys003
From git://github.com/opscode/cookbooks
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
fatal: Could not parse object '58dd958a13339dab754783755b5ff7a71b1be29c^'
Unknown exit code (128) from command: git-merge-subtree 58dd958a13339dab754783755b5ff7a71b1be29c^ -- HEAD 58dd958a13339dab754783755b5ff7a71b1be29c
cat: .git/rebase-merge/upstream: No such file or directory
@fujin
Copy link
Author

fujin commented Apr 14, 2010

% git pull -s subtree cookbooks master 2010-04-14 17:23:23 aj ttys003
From git://github.com/opscode/cookbooks

  • branch master -> FETCH_HEAD
    First, rewinding head to replay your work on top of it...
    fatal: Could not parse object '58dd958a13339dab754783755b5ff7a71b1be29c^'
    Unknown exit code (128) from command: git-merge-subtree 58dd958a13339dab754783755b5ff7a71b1be29c^ -- HEAD 58dd958a13339dab754783755b5ff7a71b1be29c
    cat: .git/rebase-merge/upstream: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment