tags:

views:

73

answers:

3

I'm trying to get started using git. Our project is in a directory with a base development system. I've got it set up great for myself, but I can't get the files over to my collaborators.

We can't do a git clone since it has to clone to an empty directory.

I tried initializing a repository in the dev directory on one of the systems, adding a remote to my repo, then running git-fetch. It did a lot of computing and downloading, but in the end, .git/ ended up with lots of stuff, but the files in the dev directory remain untouched. ls-files shows nothing.

I expected the fetch to pull down all the files. What am I misunderstanding here?

A: 

It's really unclear what you're describing in this question. Do you already have git repository setup? If 'yes', then what is the exact reason you can not clone from it? If 'no', then the first think you need to do is:

cd project/
git init
git add --all
git commit -m "Initial commit"
Casey
Yes, there is my own repository, and the (new/empty) repository on another development system that I tried to do a fetch from.The reason I can't do a git clone from my repository is because of the way the original developer set up the project - it's a large cross-platform Linux build environment. Where our project files are mixed in with an existing filesystem. Git clone to an existing directory requires it be empty; it is not (and can't be without significant effort) for our system.
Shawn J. Goff
+2  A: 

git fetch will only update the remote namespace of your dev repo.
Its working tree will remain untouched (that is "empty", except for all the legacy and private files already there)

Did you try git pull?
It would git fetch and git merge the remote content into your master branch, filling your working tree in the same time.

VonC
That did it! I thought I had tried a pull, but apparently I hadn't.
Shawn J. Goff
A: 

Use git-bundle that can transfer the whole repo contents in a archive.

For the docs

Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive git protocols (git, ssh, rsync, http) cannot be used. This command provides support for git fetch and git pull to operate by packaging objects and references in an archive at the originating machine, then importing those into another repository using git fetch and git pull after moving the archive by some means (e.g., by sneakernet). As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the destination repository.

Lakshman Prasad