16

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

I just have a PetProject directory with all the sources and the Google App Engine development server pointing 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 would 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?

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • 3
    You shouldn't need to explicitly tell App Engine to skip .git directories - if I recall correctly, it already skips dotfiles by default. – Nick Johnson May 28 '10 at 15:05
  • I recommend you the new "push to deploy" option in App Engine has a best practice to deploy your project. https://developers.google.com/appengine/docs/push-to-deploy – greg Jun 14 '13 at 13:37

1 Answers1

11

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 git@github.com:git_username/projectname.git
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 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 May 28 '10 at 15:05