Sharing Git Branches on Different Workstations: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(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...")
 
Tag: New redirect
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Git]]
#REDIRECT [[Move Uncommited Changes In Git To A Different Computer]]
== 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.<ref>[http://www.bitflop.dk/tutorials/git-bare-vs-non-bare-repositories.html Git bare vs non-bare repositories] BitFlop Tutorials</ref>
 
<syntaxhighlight lang="powershell">
> git clone --bare -l https://github.com/username/myrepo.git myrepo
</syntaxhighlight>
 
=== Windows ===
 
Now on a separate windows workstation create a remote for that local hub:
 
<syntaxhighlight lang="powershell">
> git remote add remotehubname x:\path\to\myrepo
> git push remotehubname master
</syntaxhighlight>
 
=== Mac ===
 
Mount the shared directory where the hub repo is located.
 
<syntaxhighlight lang="bash">
# optionally create a remote for the local hub
$ git push /Volumnes/sharename/path/to/myrepo master
</syntaxhighlight>
 
== Notes ==
<references />

Latest revision as of 18:42, 20 November 2021