programming (sorry) 

@alison you can pull from a local repository if it is accessible somehow via network (mounted network share/network drive, etc.) or if you have a ssh server running: just add a new remote `git add remote my_laptop ssh://user@laptop:/path/to/repo` and then just `git pull my_laptop <working_branch>` on the other machine. If you're using a GUI of some kind it will work too. If you have no ssh keys configured you'll be asked for a password though. Pushing is not supported i think

programming (sorry) 

@dunkelstern @alison

I can't see the original question, so I might be missing some piece of context.

Pushing and pulling works with ssh remotes, as well as local path remotes.

programming (sorry) 

@robryk

I am taking alison out as she has found another solution (VScode remote sharing). Are you sure you can push into a working copy via ssh? A bare clone would work for sure but a checked out working copy i am not so sure. (But i have not tested it either)

programming (sorry) 

@dunkelstern

You can push into a local or remote-over-ssh-repo.

If you have a checked out branch and are trying to push into that branch, the push will fail: you just need to check out something else (or even the same thing, just in detached HEAD mode). See the full error message at paste.sr.ht/~robryk/67de3b2290 that explains alternatives. Note that this would happen regardless of how you access the repo: it's simply that git refuses (by default) to push to a branch that's checked out.

programming (sorry) 

@robryk yeah ok, that's the missing context from the deleted toot then. The question was if you could work on two computers on the same codebase without pushing to remote. In that case the same branch would be checked out at both sides. So we're both right. It can work if the branch is not checked out, but in this special case it will not work because the same branch is kinda the point of the exercise :)

Follow

programming (sorry) 

@dunkelstern

But also you don't want to share the branch, but share the contents of the working directory. I.e. even if it worked, it wouldn't be doing the intended thing.

programming (sorry) 

@robryk yes locally committed changes would be needed. Sharing staging or uncommitted changes will not work. As alison is using vscode remote sharing now she will effectively be working on just one repo, so that's perfect for that case :)

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.