views:

378

answers:

1

I'm developing a small pet project on Google App Engine and i would like to keep code under source control using github; this will allow a friend of mine to checkout and modify the sources.

I just have a directory with all sources (call it PetProject) and Google App Engine development server points to that directory.

Is it correct to create a repo directly from PetProject directory or is it preferable to create a second directory mirroring the develop PetProject directory? In the latter case, anytime my friend will release something new, i need to pull fetch from Git copying the modified files to the develop PetProject directory.

If i decide to keep the repo inside the develop directory, skipping .git on Gae yaml is enough?

What are the best practices here?

+4  A: 

You can create a git repo directly within your current PetProject directory.

One trick would be to clone your new (and empty) GitHub repo in a local directory, and then copy the .git subdirectory in your PetProject directory.
That way, you have a Git repo already connected to a remote GitHub upstream repo.

Modify your .gitignore file to exclude what you dont 'want to publish. git add -A and then git commit -m "first commit" And then push to your GitHub repo.

Note: instead of pulling from your git repo (which means merging immediately whatever has been pushed on the same branch), you might want to fetch first, and then check what you could merge.


As Nick Johnson comments though, GitHub has a clear process to setup a remote.

 git remote add github [email protected]:git_username/projectname.git
VonC
There's no need to use the workaround you suggest - github provides easy instructions on adding a remote repo to an existing local when creating a new github repository.
Nick Johnson