简体   繁体   English

在本地,远程和存储库之间正确设置Git

[英]Setting up Git correctly between Local, remote and repository

I've been playing about with Git for about a week or two but after many days reading, I still don't know how to actually set this up correctly. 我已经和Git玩了大约一两个星期,但是经过很多天的阅读,我仍然不知道如何正确地进行设置。

I have set up a website project on my local server, installed git into the project folder and successfully pushed it to my bitbucket account I now have a clone of my project folder within Bitbucket and any changes will be uploaded once I add a commit. 我已经在本地服务器上建立了一个网站项目,将git安装到项目文件夹中,并将其成功推送到我的bitbucket帐户中。我现在在Bitbucket中拥有我的项目文件夹的克隆,一旦添加提交,所有更改都将上传。

So I now have a local server and a remote repository, What I don't understand is what I need to do no in regards to the remote server? 因此,我现在有一个本地服务器和一个远程存储库,我不了解关于远程服务器不需要做什么?

Should I be pushing to the remote server from my repository or my local server? 我应该从存储库还是本地服务器推送到远程服务器? and if so how? 如果可以,怎么办?

Thanks 谢谢

A common way to work is to have one place designated to just keeping your repository, in your case this would be Bitbucket. 一种常见的工作方式是指定一个位置仅保留您的存储库,在您的情况下,这将是Bitbucket。 When you need to make changes, have a clone of the repository on your local development machine. 当您需要进行更改时,请在本地开发计算机上复制存储库。 Push changes back to the repository at Bitbucket as needed. 根据需要将更改推回到Bitbucket的存储库。

If more people need to work on the same project, they can easily clone the same repository from Bitbucket. 如果需要更多的人从事同一项目,则可以轻松地从Bitbucket克隆同一存储库。

For deployment, either use a CI tool that will fetch from the Bitbucket repository and deploy, or write your own script that does something similar. 对于部署,请使用将从Bitbucket存储库获取并部署的CI工具,或者编写自己的脚本执行类似的操作。

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

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