Home > Back-end >  Is it possible to add files from different locations into 1 git reposito
Is it possible to add files from different locations into 1 git reposito

Time:02-21

I am trying to make a git repository of all my config files that I use (vim, VSCode etc)

What I want to have is a repo where all the config files sit. But I do not want to have to go and change the config files in my repo every time I make a change in the ACTUAL config file.

Basically, if I change some settings in my VSCode settings, I want it to be automatically reflected in the settings file in my repo. From there I can just stage the change and push to GitHub. (Something like a soft link?)

What (if any) is the best way to go about this?

CodePudding user response:

You can use symlinks to your dotfiles local repository, which bbkane/fling does.

Without any tool, you have the same idea explained in the article "~/.dotfiles" from Vincent Boutour.

The easiest tools to configure are the ones that rely on a single file on your home directory, that starts with a dot.

That's where the repository takes its name: the famous "dotfiles". You know them: the .bashrc, the .vimrc or the .gitconfig.

In order to keep the file under version control system (Git), but not committing your entire ${HOME}, the easy trick is using a symlink.
The file exists in the ${HOME} folder, so your tool can read it, but the content remains on the folder under version control.

Or you can use d3r1n/dotman (documentation), which will take any change with dotman update.

  • Related