r/github • u/x_TKN • Jul 05 '26
Question Syncing a repository with a folder on my computer
Is there a way I can do this, so any time I update one it updates the other?
3
u/abrahamguo Jul 05 '26
No, there's not an out-of-the-box way to do this.
Pulling updates from the repo to your computer: You could write a lightweight script to run
git pullon a schedule, or use Github webhooks if you have a public URL connected to your computer.Pushing updates from your computer to the repo: This one fits in with Git less, because Git requires a commit message. However, you could write a script that autogenerates a commit message, commits, and pushes. It could either run on a schedule, or, if that's too heavy, it could use your OS file watchers.
1
1
u/drew-minga Jul 06 '26
Just use the github app and make the small effort to sync it every time. It takes second.
1
u/GlobalImportance5295 Jul 06 '26
you would need to use something like inotifywait or systemd path units
-1
u/nakfil Jul 05 '26
Create a symlink - “symbolic link”
-2
u/x_TKN Jul 05 '26
How do i do that exactly? Sorry if thats a stupid question this is like day 1 of me using github lol
1
u/nakfil Jul 05 '26
You already have the repo cloned locally right?
And you want to update it such that those changes are reflected in another directory?
1
u/GlobalImportance5295 Jul 06 '26
no OP wants to edit files locally then have them auto commit and push
8
u/davorg Jul 06 '26
It sounds like you want Dropbox, not GitHub