Setting up a git bare repository on Linux -- [ tutorial ]

preview_player
Показать описание
How to set up a git bare repository on your Linux machine using the command line
1) create new repository on gitlab/github (do not init with read me)
2)open terminal and create dir with new repo name in your home dir
3) cd into new repo dir
4)type git init --bare $HOME/"your repo name here"
5)create alias for "/usr/bin/git --git-dir=$HOME/"repo name here"/ --work-tree=$HOME"

github

gitlab

email
Рекомендации по теме
Комментарии
Автор

This is the best single explanation I’ve seen yet for using a bare repo to track dot files. Thanks for the clear, concise, and complete explanation.

MikeWasylik
Автор

Thanks for this tutorial! DistroTube did one several years ago and although DT's a good teacher, I'm not sure he explained it terribly well. This takes you through it step by step, which I need because I'm a visual learner.

ringo
Автор

Thanks! I was using another tutorial video without luck. This video, particularly the push part, helped out and now my bare repository works.

Christop
Автор

Another excellent piece, although a little late 😂
I used/liked GNU Stow for a long time, and was actually enjoying it. But lately I’ve used a bare repo for all my dotfiles (starting from scratch), and I think I really really like this whole new thing of doing things. Especially coupled with the 1Password CLI/SSH client. Signing and pushing just with a fingerprint 😉

ditchcomfort
Автор

I use the CLI and Drag N Drop both and using Git is a pain either way... lol
But it the nature of the beast...
Thanks for showing some other tricks Jake!
LLAP

BrucesWorldofStuff
Автор

Question: How would I go about syncing my dotfiles on another device, for example?

Clone the GitLab repo into $HOME/dotfiles on the new device, then add my alias and do a git pull (config pull, in this case) to get everything where it initially was?

wandrease
Автор

dot config --local status.showUntrackedFiles no
this command not working, its return - fatal: --local can only be used inside a git repository
how to fix it?

wsamiulazim