26

I'm a hobbyist and butcherer of python code. Quite often i'm jumping between multiple laptops / desktops playing around with different projects. Just wondering what the best workflow is or suggestions people have around syncing projects so I can edit and work on projects regardless of the computer. Is this something that people generally manage through github?? Thanks in advance for the thoughts!

top 28 comments
sorted by: hot top controversial new old
[-] jollyroberts@jolly-piefed.jomandoa.net 28 points 4 days ago* (last edited 4 days ago)

Git version control.

Codeberg is another good service I have not seen mentioned yet.

Edit: typo

[-] towerful@programming.dev 1 points 3 days ago

Codeberg is git?
It's not GitHub! But fundamentally, it's git

[-] GammaGames@beehaw.org 1 points 3 days ago* (last edited 3 days ago)

codeberg requires everything to be open source and only allows private repos that support open source projects

interesting, I did not know that. piefed is on there so that has been my main interaction with the service. i use gitlab for my personal private repos.

[-] hoppolito@mander.xyz 2 points 3 days ago* (last edited 3 days ago)

You can have a couple of private repos on codeberg no problem, it's just that if you start using a lot of HDD space for them without also contributing stuff that they don't like it

So it's technically true that if you never contribute to any projects they don't love private repo-only accounts, but it's a pretty relaxed rule.

Nevertheless a good list of other forgejo instances is e.g. here.

[-] GammaGames@beehaw.org 2 points 3 days ago* (last edited 3 days ago)

That makes sense, it’s not like code takes up much space!

[-] Midnitte@beehaw.org 20 points 4 days ago

Yes, using a remote code repository (i.e. git) - plenty of options aside from github.

Merely git pull the repository to whatever machine you want to work on and commit the changes back (rinse, repeat)

[-] YeahToast@aussie.zone 2 points 3 days ago

Ok perfect, thank you! I'll have to spend a bit of time learning best practice around git. Thanks for the prompt about GitHub alternatives.

[-] japemasterBrad@piefed.social 15 points 4 days ago

Git is the way. I run a Gitea instance so all my code lives on my home server but have used Github in the past.

[-] YeahToast@aussie.zone 2 points 3 days ago

Perfect thank you. I haven't quite got a home server up and running yet, but am trying to keep things stored locally. Will look into it, thank you

[-] sip@programming.dev 3 points 3 days ago

code goes in git which you can push to other devices and pull from other devices. but if you're not used to it and you turn off a machine and forget to push... you're stuck.

for syncing files in general, I use syncthing. open source, e2e encrypted.

[-] solrize@lemmy.ml 8 points 3 days ago

Just use git and a remote repo. Don't need GitHub or anything of that sort.

[-] YeahToast@aussie.zone 2 points 3 days ago

Thanks, I'll look into that :)

[-] towerful@programming.dev 6 points 3 days ago

Git. Git git git.
If it is text and can be modified from multiple places, should have a single "main" branch and feature work done independently on separate "branches". Or even just a "back this up".
Git.

Git is text based version control (tho it will do binary file, just not elegantly).

So yeh, git.
GitHub is easy to host on, but owned by Microsoft and is somewhat proprietary (by the time issues and other enhancements GitHub provides), but at the end of the day it is git with authentication and is on the ol "cloud".
Plenty of ways to replicate this if it's just for you

[-] YeahToast@aussie.zone 3 points 3 days ago

Thanks for your reply, I definitely have to look up the best practices for git storage / branches etc as I have no idea. Pretty keen to distance myself from Microsoft where able.

[-] 14th_cylon@lemmy.zip 10 points 4 days ago

yes, it is something people generally manage through git. github or gitlab (if you want to avoid microsoft)

[-] YeahToast@aussie.zone 3 points 3 days ago

Excellent, thanks for the reply.

[-] 14th_cylon@lemmy.zip 4 points 3 days ago* (last edited 3 days ago)

if you are new to git, these sources might help:

  1. https://git-scm.com/book/en/v2 - number one source, available online, for free, has complete translation to quite a few languages

[-] beeng@discuss.tchncs.de 5 points 3 days ago

Even though there are other ways to solve it, git is the right learning path.

[-] rompe@feddit.org 1 points 2 days ago

One more thing regarding Git:

You'll likely want to keep your main branch functional at all times, so you would normally wait with your commit and push until a feature is ready. This wouldn't mix well with switching machines at random times.

That's where branches come in handy: create a feature branch, commit and push as often as you want. If the feature doesn't happen to work out, just delete the branch. When the feature is ready, merge the branch into the main branch. There even is an option to squash commits into a single one when merging, so you don't have to keep the whole commit history you created in the feature branch.

[-] RonSijm@programming.dev 3 points 3 days ago

I don't think this has been mentioned, but it kind of depends on where your multiple laptops / desktops are. Is this always on your own home network? Because in that case you don't even need a remote service like Github

If so, you can create a network drive on any of the devices - mount the network device on your other devices, and then create a local git repo there. Just remember that using an external git service is also a backup. So if you do everything locally, make sure to have your own backups in place

A much, much worse but also possible solution is to just put your projects into onedrive/dropbox/gdrive and sync it everywhere. It works for syncing, since you're saying that's the main objective - but you lose out on version control

[-] YeahToast@aussie.zone 1 points 3 days ago

Thanks for your reply. I've started using tailscale so I think that could help re: remote access. An interesting thought about a shared network drive though.. I'm not yet at a point where I've got a server running 24/7 but I will be at some point (when RAM and storage stop killing me), which I think could be a good option outside of git

[-] swicano@programming.dev 3 points 3 days ago

I'll add one more perspective: git is the "right" way to do it, but I'm a lazy forgetful person who wants to work on the laptop but the changes on the desktop aren't committed or pushed remote. What I often do is to use VScode's remote development tools to open a remote connection the last computer with uncommitted changes, and work like that. If I'm headed out, I'll use the remote connection to commit the code so I can access it off my home network via codeberg.org.

Occasionally if I'm already out, I've even used "raspberry pi connect" to remote onto my network, then ssh over to my desktop, then commit and push. Don't do that though. That'd be irresponsible.

[-] entwine@programming.dev 2 points 3 days ago

Just set up wireguard and use that to connect to your home network when you're out.

[-] YeahToast@aussie.zone 1 points 3 days ago

Thanks for your reply . I've started using tail scale and rusk desktop for my remote access although I'm still fumbling through it.

[-] fruitcantfly@programming.dev 2 points 3 days ago

I use Mega(sync) to keep my various PCs in sync. Before that I used SpiderOak for a number of years, but the service started degrading at some point, which forced me to switch.

While committing to a git host is not a bad idea, it doesn’t cover all the stuff you might want to sync in my experience

[-] YeahToast@aussie.zone 1 points 3 days ago

Ah, haven't heard of that before. Thanks for your reply, I'll look into it :)

[-] Michal@programming.dev 1 points 3 days ago

I used to use Dropbox for this, and it works, it's automatic, so you'll have the latest copy without manually pulling changes.

However, for any non-throwaway code i use git now. It gives me granular edit history via commits, branches for experimental changes, and i can push it to github where i can run tests and deployments for free. However if you're using git, you still need to run commit, push, pull commands but if you use an IDE or even a modern editor, it'll have hot keys for it already.

Also there are files you're not supposed to commit, like binaries and 3rd party dependencies so you may need to setup a virtualenv and run pip install on each machine independently.

this post was submitted on 05 Feb 2026
26 points (100.0% liked)

Python

7746 readers
2 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS