0

Sorry if the question seems ignorant, and sorry for the bad misleading title; I can't describe my problem in one sentence.

I run Arch Linux.

I have a Git repository with my dotfiles (configs). And all of my dotfiles are in ~/.config, I want to link a directory in ~/.config to the directory that Git is initialized on which is in ~/.dotfiles. I've already remotely connected the local repository to GitHub.

I don't want to edit two files every time I want to make a change. I also don't want to initialize git in ~/.config because I only want to publish the dotfiles of one program and it doesn't really make sense to put all the other +100 directories in a .gitignore file.

Configurations in ~/.config are the ones that make changes to the programs. And the configurations in ~/.dotfiles are just for show so they can be published to GitHub. I want to be able to edit either one and automatically have the changes synced to the other.

All I want is that when I make a change to one of the directories, the change gets synced to the other directory, so I don't have to overwrite the other directory manually every time I make a change.

I've tried symlinks, but when I link the two directories with the ln command and then edit files in one directory, it doesn't apply in the other one.

sudo ln -sf ~/.dotfiles/.config/awesome ~/.config/awesome
# I've also tried
sudo ln -sf ~/.config/awesome ~/.dotfiles/.config/awesome

I know I can edit files in one directory then sync it manually with mv to overwrite the other directory with the changes; this will work, but the amount of programs will increase so I will have to manually sync all the programs. I am just looking for a simple way to do it, I also heard about rsync, but I think it isn't related to my problem.

EDIT:

If this doesn't make sense, just tell me how 'dotfile' repositories work, like how is this repo is made.

5
  • 1
    Can you demonstrate how you were creating the symlinks? Commented Jul 18, 2022 at 15:54
  • I think something like this can give answers, he use git flags (--git-dir, --work-home) fwuensche.medium.com/… I personally just use yadm tool. Commented Jul 18, 2022 at 15:58
  • @user1686 Edited the post
    – TechTycho
    Commented Jul 18, 2022 at 16:01
  • 1
    In both cases, did you look with ls -l to check whether a symlink was actually created in the correct location? Commented Jul 18, 2022 at 16:08
  • @user1686 Yes, I've tried and found symlinks.
    – TechTycho
    Commented Jul 18, 2022 at 16:15

0

You must log in to answer this question.

Browse other questions tagged .