简体   繁体   English

如何从网络主机上的现有项目到Github创建Git工作流程?

[英]How do I create a Git workflow from my existing project on a web host to 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. 我是Git领域的新手,但我意识到,由于我和我的程序员将同时处理文件,因此我们需要建立一个Git工作流程。 I have very minimal experience with Git from a 3 month project I did last year so I need help setting this up. 去年我做了一个3个月的项目,对Git的经验很少,因此我需要帮助进行设置。

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. 我通常使用连接到服务器的Coda远程修改文件。

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. 我们在Github上购买了一个月的服务来创建一个私有存储库,以便我们可以使用Github的GUI反馈通过漂亮的UI来查看差异以解决错误。

On the web host account, no Git repository is setup yet. 在Web主机帐户上,尚未设置任何Git存储库。 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. 我不完全了解如何将文件传输到Github,但是我想我需要先在Web主机帐户上创建一个存储库,然后再将其推送到Github帐户。

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! 谢谢!

When working with GitHub repo, you have two choices: 使用GitHub存储库时,有两种选择:

  • add your team as collaborator for your repo (they can push directly to said repo) 将您的团队添加为您的存储库的协作者(他们可以直接推送到所述存储库)
  • ask them to fork your repo (clone on the GitHub side), then making pull requests in order for you to integrate their changes. 请他们分叉您的仓库 (在GitHub上克隆),然后发出拉取请求 ,以便您集成他们的更改。

Since we are talking private repo, the first solution is more practical (to avoid having to setup different private, ie 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: 对于给定的开发工作,您需要从那里建立一个分支/合并工作流,以决定是否要由多个人处理同一组文件,如果满足以下条件:

  • each developers will work on the same common branch (in which case they need to rebase and resolve any conflict locally , before pushing their commits) 每个开发人员将在同一个公共分支上工作(在这种情况下, 他们需要在推送其提交之前在本地重新建立基础并解决任何冲突
  • each developers will work on a user-specific branch (in which case, they can push whenever they want, but an integrator will have to pull said branches and do the merge). 每个开发人员都将在用户特定的分支上工作(在这种情况下,他们可以在任何需要的时候进行推送,但是集成商必须拉出所述分支并进行合并)。

(see also " when should you branch? " and the second part of " Why uses git fast-forward merging per default? ") (另请参阅“ 何时分支? ”和“ 为什么默认使用git快速转发合并的第二部分 ”)

Here's a great guide on github: 这是关于github的出色指南:

http://help.github.com/create-a-repo/ 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. 我将首先从Web主机下载内容,这样您就可以在本地拥有所有内容,然后再推送到github。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将我的项目重新连接到我现有的 GitHub 存储库 - How do I reconnect my project to my existing GitHub repository 从github克隆了一个git仓库-我如何在我的账户中创建一个新的github仓库 - cloned a git repository from github - how do i create a new github repository into a repository into my account 我如何git隐藏我的工作,从github提取,然后将我的工作放回项目中? - How do I git stash my work, pull from github, and put my work back into project? 创建了github页面后,如何修改git工作流程? - How to modify my git workflow now that I created github pages? 如何在 github 上托管我的网站 - How do I host my website on github 在现有开放源代码项目上进行协作-如何使用git / github? - collaborating on an existing open source project - how do I use git / github? 如何将现有的非git java项目导入github存储库? - How do I import an existing non-git java project into a github repository? Git:如何将分支从现有项目推到GitHub? - Git: how to push a branch from existing project to GitHub? 如何为我的 Yeoman 项目创建部署 git 分支? - How do I create a deploy git branch for my Yeoman project? 我如何将github项目叉到github外部的git repo上? - How do I fork a github project to a git repo outside github?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM