How to manage your dotfiles on github
-
Go to your github account and create a "dotfiles" repositoryand initialize it with a Readme.md file
-
Clone it to your $HOME and give it a ".dotfiles" name
-
Install gnu stow -> "apt install stow" and optionally [xstow and stows - this one is from github]
-
cd ~/.dotfiles/
-
Test it with:
-
echo "This is a dotfile." > mydotfile
-
git add mydotfile
-
git commit -m "create dotfiles repository"
-
ln -s $HOME/.dotfiles $HOME/.mydotfile
-
ls -la | grep mydotfile
-
Create packages to stow - a package is a folder containing files and/or folders - gnu stow does not symlink single files
-
cd ~/.dotfiles
-
mkdir emacs && cd emacs
-
cp ~/.emacs.d/ ~/.emacs.d_bak
-
mv ~/.emacs.d/ emacs/
-
make a .gitignore or .gitignore_global in your "~./.dotfiles" and add some excluding rules
-
stow .emacs.d
-
git add emacs
-
git commit -c "my emacs config"
-
git push
-
Make as many packages as you want. Stow them and push them to your git repository
Source: https://alexpearce.me/2016/02/managing-dotfiles-with-stow/
SSh Generate an ssh-key to connect to github
ssh-keygen -t rsa -b 4096 -C $email-address
Copy the contents of the id_rsa.pub file to your clipboard
xclip -sel clip < ~/.ssh/id_rsa.pub
you can access github url through your token now
and use https://github.com/microsoft/Git-Credential-Manager-Core#linux-install-instructions
https://github.com/microsoft/Git-Credential-Manager-Core/blob/main/docs/linuxcredstores.md
credential manager https://github.com/microsoft/Git-Credential-Manager-Core#linux-install-instructions
https://www.w3docs.com/snippets/git/how-to-generate-ssh-key-for-git.html
and change the access to ssh: note: you have to create the rsa.pub using ssh port default (22) https://help.github.com/em/articles/changing-a-remotes-url
Workflow
- git add . or a specific file
- git commit -a or:
- git commit -m "any message"
- git status
- git push
Cleaning Ignored Files
In three steps, you can clean up your repository and make sure your ignored items are indeed ignored:
$ git rm -r --cached . $ git add . $ git commit -m "Clean up ignored files"
https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git pos
https://hacker-tools.github.io/dotfiles/
test t. p.