Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jclouds Wiki" for 
change notification.

The "PromoteProvider" page has been changed by IgnasiBarrera:
https://wiki.apache.org/jclouds/PromoteProvider?action=diff&rev1=1&rev2=2

Comment:
Added note about special characters in OSX

   * Move the code to the right folder in the new repo.
   * Be able to work with the main repo normally: being able to merge, rebase, 
etc, without issues.
  
- The original tutorial can be found at: 
https://www.vlent.nl/weblog/2013/11/02/merge-a-separate-git-repository-into-an-existing-one/
+ It is inspired by 
[[https://www.vlent.nl/weblog/2013/11/02/merge-a-separate-git-repository-into-an-existing-one/|this
 post]] but has sensible changes, so pay attention to detail when running the 
commands below.
  
  == Promotion example: Chef ==
  
@@ -32, +32 @@

  First thing to do is to isolate each folder to be moved to its own branch, 
and also moving it to the directory where it will be placed once merged. This 
can be done using `git filter-branch` as follows:
  
  {{{
+ # Make sure we don't commit accidentally the filtered branches
+ git remote rm origin
+ 
  # Create a branch that only contains jclouds-chef/core
  cd /tmp/jclouds-chef
  git checkout -b only-core
  git filter-branch --index-filter \
    'git ls-files -s | sed "s-\t\"*-&apis\/chef/-" | 
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
-   git update-index --index-info && mv "$GIT_INDEX_FILE.new" 
"$GIT_INDEX_FILE"' --subdirectory-filter core/ HEAD
+   git update-index --index-info && mv "$GIT_INDEX_FILE.new" 
"$GIT_INDEX_FILE"' --subdirectory-filter core/ -f HEAD
+ git clean -d -f
  
  # Create a branch that only contains jclouds-chef/enterprise
  git checkout master
  git checkout -b only-enterprise
  git filter-branch --index-filter \
    'git ls-files -s | sed "s-\t\"*-&providers\/enterprisechef/-" | 
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
-   git update-index --index-info && mv "$GIT_INDEX_FILE.new" 
"$GIT_INDEX_FILE"' --subdirectory-filter enterprise/ HEAD
+   git update-index --index-info && mv "$GIT_INDEX_FILE.new" 
"$GIT_INDEX_FILE"' --subdirectory-filter enterprise/ -f HEAD
+ git clean -d -f
  }}}
  
- '''IMPORTANT NOTE''': In the `filter-branch` command we are doing two things: 
filtering only the contents and history of the files in the directory specified 
by the ''subdirectory-filter'' parameter,  and moving them to the folder where 
they will land once merged in the main repo (specified in the ugly `sed` 
command).
+ In the `filter-branch` command we are doing two things: filtering only the 
contents and history of the files in the directory specified by the 
''subdirectory-filter'' parameter,  and moving them to the folder where they 
will land once merged in the main repo (specified in the ugly `sed` command).
+ 
+ '''OSX users''': In OSX, the `<TAB>` character in the `sed` command won't be 
recognized if you type the `\t`. You have to type it as described 
[[http://nixtricks.wordpress.com/2012/05/07/sed-replace-a-tab-character-using-sed/|here]].
  
  === Merge the branches into the main repo ===
  

Reply via email to