Live data from Hacker News

Local Git remotes

cblgh.org

1–10 of 85 posts

Re: Local Git remotes

#4
post #3

GitHub has been such a staple of the modern dev that some are now (re)discovering git is distributed.

Everything old is new again. I wouldn't be surprised if there were people that thought GitHub invented git.

More precisely, a movement to leave GitHub mistakenly endeavors to leave git.

Re: Local Git remotes

#5
What's the purpose of this? I don't get it. Why push at all to "local remote", if you can just keep your changes on a local branch, and push it whenever "remote remote" becomes available again?

Re: Local Git remotes

#7
you can also setup a local remote which hardlinks the index so it doesn't occupy more space. Why? Idk. You don't want to share stash, rerere-cache, branches whatever.

Also handy if you're running an agent in a container on the local fs. Set up a local clone, contain the agent to that repo folder and have it hack away on that. Later, you step out of the container and do the syncing. You can't use worktrees in this situations.

Bare repos are also pretty cool. You can clone the git mailing list as a bare repo and search for threads there instead of setting up an mbox (same for the kernel obviously)

Re: Local Git remotes

#8

A "local remote" is a contradiction. Unless the remote is on a different disk you are just wasting space. Even then the point of remotes is for sharing, not for backup/redundancy.

The remote can be a shared directory that multiple users have access to, and the working directory is private where each user only has private read + write access.

Re: Local Git remotes

#9

A "local remote" is a contradiction. Unless the remote is on a different disk you are just wasting space. Even then the point of remotes is for sharing, not for backup/redundancy.

What if you have a few local machines you’re using for development, and want to keep them in sync? This method allows that single central repo without having to bounce all the code through a cloud hosting service.

Re: Local Git remotes

#10
post #7

you can also setup a local remote which hardlinks the index so it doesn't occupy more space. Why? Idk. You don't want to share stash, rerere-cache, branches whatever. Also handy if you're running an agent in a container on the local fs. Set up a local clone, contain the agent to that repo folder and have it hack away on that. Later, you step out of the container and do the syncing. You can't use worktrees in this sit…

At that point you might as well use a worktree[1].

[1]: https://git-scm.com/docs/git-worktree

Post reply on HN