简体   繁体   English

用github设置git

[英]Setting up of git with github

I am a newbie to git. 我是git的新手。 I have a question for you. 我有一个问题问你。

We 4 people are working on a php project . 我们4个人正在从事php项目。 It is hosted at linux vps server. 它托管在linux vps服务器上。 Currently we are downloading files directly from server and make changes and upload back using FTP. 目前,我们正在直接从服务器下载文件并进行更改,然后使用FTP上传回来。

How we will set up git in this environment. 我们将如何在这种环境中设置git。

Just go to github, choose the plan you need (I guess you need private repository). 只需转到github,选择所需的计划(我想您需要私有存储库)。 I think you should also create organization . 我认为您也应该创建组织

Then you create repository and follow the steps described there. 然后创建存储库,并按照此处描述的步骤进行操作。 The easiest would just just to run 最简单的只是运行

git clone your_repository

If you want to setup a private git server to manage your change, you can follow this tutorial : 如果您想设置一个私人git服务器来管理您的更改,则可以按照以下教程进行:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-git-server-on-a-vps https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-git-server-on-a-vps

If you only have 4 people, you can use github ( https://github.com ) with private repo. 如果只有4个人,则可以将github( https://github.com )与私人仓库一起使用。 It is the most convenient way to control your code changes. 这是控制代码更改的最便捷方法。

Perhaps start with the Pro Git book . 也许从Pro Git书开始 This book explains how Git works and is available in many languages. 本书介绍了Git的工作原理,并提供了多种语言版本。

Chapter 4 explains about Git on a server and setting up your own remote repositories. 第4章介绍了服务器上的Git以及如何设置自己的远程存储库。 However, this is complex to set up and like k0ner explains you might want to use GitHub. 但是,这设置起来很复杂,就像k0ner解释的那样,您可能想使用GitHub。 This is a public Git hosting site. 这是一个公共的Git托管站点。 It is by far not the only one, check the Pro Git book chapter 4.9 for a link to an extensive link. 它不是唯一的,请查看Pro Git书籍的4.9章以获取指向广泛链接的链接。

In our company, we use a paid plan with GitHub and our repositories are private. 在我们公司中,我们对GitHub使用付费计划,并且我们的存储库是私有的。 First, we read the Pro Git book to understand how Git works. 首先,我们阅读Pro Git书,以了解Git的工作原理。 Next, we searched online for how other people use Git, specifically, what workflow do they use. 接下来,我们在线搜索了其他人如何使用Git,特别是他们使用什么工作流程。 An example is gitflow , or check how Atlas uses Git. 例如gitflow ,或者检查Atlas如何使用Git。 Based on this research, our code and our future goals we decided on repositories and a public hosting site (GitHub). 基于这项研究,我们的代码和我们的未来目标,我们决定在存储库和公共托管站点(GitHub)上进行决策。 We are using Git and GitHub happily now. 我们现在正在愉快地使用Git和GitHub。

ps I do not have enough rep to post more links, apologies. ps我没有足够的代表来发布更多的链接,抱歉。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM