Google App Engine and Git best practices

2019-03-10 07:11发布

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?

1条回答
趁早两清
2楼-- · 2019-03-10 07:57

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
查看更多
登录 后发表回答