如何创建从 Web 主机上的现有项目到 Github 的 Git 工作流程?
我是 Git 世界的新手,但我意识到,由于我和我的程序员将同时处理文件,因此我们需要建立一个 Git 工作流程。去年我做的一个为期 3 个月的项目中,我对 Git 的经验非常少,所以我需要帮助来设置它。
目前,我在网络主机上有一个帐户,其中存在所有当前项目文件。我通常使用连接到服务器的 Coda 远程修改文件。
我们在 Github 购买了一个月的服务来创建一个私有存储库,这样我们就可以使用 Github 的 GUI 反馈来解决错误,使用漂亮的 UI 来查看差异。
在 Web 主机帐户上,尚未设置 Git 存储库。我不完全了解如何将文件传输到 Github,但我认为我需要首先在 Web 主机帐户上创建一个存储库,然后将其推送到 Github 帐户。
这听起来正确吗?我们将哪个帐户设置为主存储库?除了我写的内容之外,我不确定我是否完全理解如何执行每一项操作,或者是否有更好的方法来执行我所解释的操作。
我非常感谢您的反馈,如果可能的话,请有人写下有关如何执行此操作的明确说明。谢谢!
I'm new to the Git world but I realize that, since my programmer and I are going to be working on files at the same time, we need to establish a Git workflow. I have very minimal experience with Git from a 3 month project I did last year so I need help setting this up.
Currently, I have an account at a web host where all the current project files exist. I typically modify the files remotely using Coda connected to the server.
We purchased a month of service at Github to create a private repository so that we can use the GUI feedback of Github to solve bugs using the pretty UI to see the diffs.
On the web host account, no Git repository is setup yet. I do not completely understand how to transfer the files to Github but I assume I would need to create a repository on the web host account first and then push this to the Github account.
Does this sound correct? Which account would we set as the master repository? Beyond what I wrote, I am not sure I completely understand how to do every or if there's a better way to do what I've explained.
I'd appreciate your feedback and if possible someone to write explicit instructions on how to do this. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 GitHub 存储库时,您有两种选择:
由于我们正在谈论私有存储库,因此第一个解决方案更实用(以避免必须为每个开发人员设置不同的私有(即非免费)存储库)。
从那里,您需要设置分支/合并工作流程< /a> 决定是否需要,对于给定的开发工作(其中多个人在同一组文件上工作),如果:
(另请参阅“什么时候应该分支?”和“的第二部分<一href="https://stackoverflow.com/questions/2850369/why-uses-git-fast-forward-merging-per-default/2850413#2850413">为什么默认使用 git 快进合并? ”)
When working with GitHub repo, you have two choices:
Since we are talking private repo, the first solution is more practical (to avoid having to setup different private, i.e. not free, repos for each developers).
From there you need to setup a branch/merge workflow decide if you want, for a given development effort where several people work on the same set of files, if:
(see also "when should you branch?" and the second part of "Why uses git fast-forward merging per default?")
这是 github 上的一个很棒的指南:
http://help.github.com/create-a-repo /
我会先从网络主机下载内容,这样你就可以在本地拥有所有内容,然后再推送到 github。
Here's a great guide on github:
http://help.github.com/create-a-repo/
I'd download the content from the web host first, so you have everything locally, and then push up to github.