Sharing Git Branches on Different Workstations

From Littledamien Wiki
Revision as of 05:06, 4 February 2016 by Video8 (talk | contribs) (Created page with "Category:Git == Goal == Work on code changes on multiple workstations without pushing changes to central GitHub repo. == Workflow == Create a localized distribution th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Goal

Work on code changes on multiple workstations without pushing changes to central GitHub repo.

Workflow

Create a localized distribution that can be seen by the various workstations.

//myserver/develop/path/to/repo

This Git repo must be "bare" in order to accept pushes.[1]

> git clone --bare -l https://github.com/username/myrepo.git myrepo

Windows

Now on a separate windows workstation create a remote for that local hub:

> git remote add remotehubname x:\path\to\myrepo
> git push remotehubname master

Mac

Mount the shared directory where the hub repo is located.

# optionally create a remote for the local hub
$ git push /Volumnes/sharename/path/to/myrepo master

Notes