Skip to content

Instantly share code, notes, and snippets.

@alexjaw
Created January 28, 2023 14:57
Show Gist options
  • Save alexjaw/e48d317dc39d98fc9ffd79c55d80af8a to your computer and use it in GitHub Desktop.
Save alexjaw/e48d317dc39d98fc9ffd79c55d80af8a to your computer and use it in GitHub Desktop.
git bare repo
The problem:
If several people are working on the same account (Linux) then it creates problems to work with remote git repos. You just do not want to store your ssh credentials in the same account.
Solution:
Set up a bare git repo that works as a "remote repo" where all users are pulling and pushing to this bare repo and not to the real remote git server. Benefits:
do not need any credentials to push to the bare repo
do not need to set up new Linux account (maybe that would have been better)
On you own local machine you set up a new remote, for example rpipoc01. Then you can push the git repo to the bare repo. After that you can clone from the bare repo to the repo where you intend to perform the work. When finished, push to the bare repo. In order to push the updates to the server, you pull the updates from bare repo to your own machine (specify when pulling the bare repo, for example rpipoc01). The push (or pull request) to the server.
git clone /home/pi/bare_repos/sss-poc-imx-web-packager.git
cd sss-poc-imx-web-packager/
git fetch --all
git remote rename origin rpialex
git checkout development-common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment