将git更改推入共享网络驱动器 [英] Push git changes to a shared network drive

查看:112
本文介绍了将git更改推入共享网络驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

四人团队如何使用Git(特别是 Github for Windows )将本地更改推送到共享网络驱动器?



现在(无Git),我们必须将文件从网络驱动器复制到本地计算机,编辑文件,然后将其重新上传到共享网络驾驶。这是一个艰难的过程,可能导致很多错误,但它似乎是Git可以帮助我们的。



我们可以简单地在共享驱动器上安装Git并去从那里开始?

解决方案

不知道你是否找到了适合你的东西,但我有一个关于如何做的文章这是在Windows网络驱动器上的东西:

http://tony.halcyonlane.com/blog/2011/09/22/Using-git-at-work-on- a-Windows-network-drive /

从cmd提示符切换到映射驱动器。



< blockquote>

$ cd g:

然后切换到您的git仓库。


$ cd脚本


然后创建一个空的git存储库。如果你不使用--bare选项,你将会遇到问题,所以不要离开它。


$ git init - 现在,如果你还没有本地的git仓库,那么你可以通过导航返回克隆你的新仓库到您的本地驱动器。


$ c:



$ cd work / scripts



$ git克隆文件:// g:\scripts

当你克隆时,你会自动获得一个名为origin的远程服务器,并且只要你在本地进行修改,你就可以推送到服务器以保证安全。


$ git push origin master

如果你已经拥有一个git仓库并且你只是想推出共享驱动器,那么你可以在你的本地git目录中完成。



lockquote
$ git remote add origin file:// g:\scripts



$ git push origin master


How can a team of four people use Git (specifically Github for Windows) to push local changes to a shared network drive?

Right now (without Git) we have to copy the files from the network drive to our local machine, edit the files, and then re-upload them to the shared network drive. This is a painstaking process that can lead to lots of errors, but it seems like something Git could help us with.

Can we simply install Git on the shared drive and go from there?

解决方案

Not sure if you found something that works for you or not, but I have a writeup on how to do that very thing on a windows network drive:

http://tony.halcyonlane.com/blog/2011/09/22/Using-git-at-work-on-a-Windows-network-drive/

From a cmd prompt change to your mapped drive.

$ cd g:

Then cd into your soon to be git repository.

$ cd scripts

Then create an empty git repository. If you do not use the --bare option, you will have issues so don't leave that out.

$ git init --bare

Now if you don't have a local git repository yet, then you can clone your new repository wherever you like by navigating back to your local drive.

$ c:

$ cd work/scripts

$ git clone file://g:\scripts

When you clone, you automatically get a remote called "origin" and you can push to the server for safe keeping any time you make changes locally.

$ git push origin master

If you already have a git repository and you just want to push out to the shared drive then you can do this from within your local git dir.

$ git remote add origin file://g:\scripts

$ git push origin master

这篇关于将git更改推入共享网络驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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