Skip to content

Instantly share code, notes, and snippets.

View b1bradders's full-sized avatar
👨‍🍳
cooking up a dozen projects

Bradlee Barnes b1bradders

👨‍🍳
cooking up a dozen projects
  • United Kingdom
  • 07:17 (UTC)
View GitHub Profile
@b1bradders
b1bradders / local-git-repo.md
Created October 27, 2026 21:25
Instructions for creating a local Git repo that can be pushed and pulled between multiple devices, locally.

Local Git repo instructions

Remote

  1. Initialise a normal Git repo in the directory you want to sync.
  2. Then, initialise a bare Git repo in an arbitrary Git folder: git init --bare ~/git/(project name).git
  3. Then, in the normal Git repo, add the bare Git repo as a remote: git remote add (remote name) "$HOME/git/(project name).git"
  4. Finally, push from the normal Git repo to the bare Git repo: git push -u (remote name) main

Example

# init a new empty git repo.
usr@host:~/Projects/NS-Ticket-Fetcher$ git init .