Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push git changes to a shared network drive

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?

like image 895
user1549303 Avatar asked Jul 24 '12 16:07

user1549303


People also ask

Can you use git on a shared drive?

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. Show activity on this post. Git installed on their local machine. Access to their own personal shared drive ( L: )

How do I push changes to a git repository?

To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.

How do I push changes to my remote repository?

To push the commit from the local repo to your remote repositories, run git push -u remote-name branch-name where remote-name is the nickname the local repo uses for the remote repositories and branch-name is the name of the branch to push to the repository. You only have to use the -u option the first time you push.


1 Answers

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

like image 189
Tony Eichelberger Avatar answered Sep 17 '22 21:09

Tony Eichelberger