Google App Engine和Git最佳做法 [英] Google App Engine and Git best practices

查看:115
本文介绍了Google App Engine和Git最佳做法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Google App Engine上开发一个小型宠物项目,并且希望使用 github将源代码保存在源代码管理之下;这将允许我的一个朋友检出和修改源文件。

我只有一个 PetProject 目录源和指向该目录的Google App Engine开发服务器。

直接从PetProject目录创建repo是否正确,还是最好创建第二个目录镜像开发 PetProject 目录?

在后一种情况下,任何时候我的朋友会发布新的东西,我需要 pull 从Git获取,将修改过的文件复制到开发 PetProject 目录中。



如果我决定将repo放在开发目录,在Gae yaml上跳过 .git 就足够了?



这里有什么最佳实践?

解决方案

您可以在您当前的PetProject目录中直接创建一个git仓库。

一个技巧是将新的(和空的)GitHub仓库克隆到本地目录中,然后复制 .git 在您的PetProject目录下的子目录。

这样,您就可以将Git仓库连接到远程GitHub上游仓库了。



修改您的.gitignore文件来排除你不想发布的东西。
git add -A ,然后 git commit -mfirst commit
然后推到你的GitHub仓库。



注意:不要从你的git仓库(这意味着立即合并在同一分支上的仓库)先获取一个href =https://stackoverflow.com/questions/1331385/how-can-i-see-incoming-commits-in-git>然后检查你可以合并的内容。 p>




由于尼克约翰逊评论虽然,GitHub有一个清除进程以设置远程设备

  git remote add github git@github.com:git_username / projectname。 git 


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?

解决方案

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

这篇关于Google App Engine和Git最佳做法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆