tags:

views:

41

answers:

3

I worked with a graphic designer that did not clone from my github account. He downloaded the project from source rather than using the command "git clone". Since he pulled his files, a month has gone by and I want to do the following tasks:

  1. Create a new branch
  2. Push the graphic designers project into that branch
  3. Merge his branch with Master

I've tried the following the github forking guide with not much luck; when I attempt to push the files into a new branch I get an error: fatal: Not a git repository (or any of the parent directories): .git

How do I do this?

A: 

Clone the repository, make the branch, check it out, put the files in place, add, commit, push.

Ignacio Vazquez-Abrams
+2  A: 

You can do this using an existing checkout. First, create a branch to store the designer's changes:

git checkout -b graphics

Next, copy his files on top of the existing files in that project. You can use git status to confirm that you've got all the files. Then, commit the changes to that new branch.

You can then merge that branch into master using the usual merge methods.

Greg Hewgill
A: 

Try looking into rebase --onto

Basically, init a git repo in the designer's working directory, let him commit his work as a first commit.

then add a remote to your github, fetch it, then rebase his local master --onto the github master

Note: I haven't tried this myself, so you might wanna try it on a dummy project first.

git init
git add <stuff>
git commit -m"designer's work"
git remote add hub <github-clone-url>
git fetch hub
git rebase --onto hub/master
hasen j