JZ.
JZ.

Reputation: 21907

Git How do I Push a project, that was Downloaded from Source

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?

Upvotes: 1

Views: 438

Answers (3)

hasen
hasen

Reputation: 166372

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

Upvotes: 0

Greg Hewgill
Greg Hewgill

Reputation: 994777

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.

Upvotes: 2

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799490

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

Upvotes: 0

Related Questions