From 4db367c1e7a4a60cc8e5f8dc274d57a15cb9e7e7 Mon Sep 17 00:00:00 2001 From: srdusr Date: Tue, 13 Dec 2022 19:28:16 +0200 Subject: Add dollar signs to commands line commands --- tools/git.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'tools') diff --git a/tools/git.md b/tools/git.md index a709d97..d073903 100644 --- a/tools/git.md +++ b/tools/git.md @@ -2,83 +2,83 @@ #### Creating a dotfile git repo 1. Intialize git and create a folder named ~/.cfg ```bash - git init --bare $HOME/.cfg + $ git init --bare $HOME/.cfg ``` 2. Put this in your .bashrc or .zsh to use `config` as a dotfiles alias. ```bash - alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' + $ alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' ``` 3. Make sure to ignore the folder we're going use to clone. ```bash - echo ".cfg" >> .gitignore + $ echo ".cfg" >> .gitignore ``` 4. Set flag to not show untracked files ```bash - config config --local status.showUntrackedFiles no + $ config config --local status.showUntrackedFiles no ``` 5. Replacing git with our newly created config alias we can version control our dotfiles. ```bash - config status - config add .bashrc - config commit -m "Added bashrc" - config push + $ config status + $ config add .bashrc + $ config commit -m "Added bashrc" + $ config push ``` #### Installing onto a new system 1. Avoid weird behaviour/recursion issues when .cfg tries to track itself ```bash - echo ".cfg" >> .gitignore + $ echo ".cfg" >> .gitignore ``` 2. Clone the repo ```bash - git clone $HOME/.cfg + $ git clone $HOME/.cfg ``` 3. Set up the alias 'config' ```bash - alias config='/usr/bin/git --git-dir= --work-tree=$HOME' + $ alias config='/usr/bin/git --git-dir= --work-tree=$HOME' ``` 4. Set local configuration into .cfg to ignore untracked files ```bash - config config --local status.showUntrackedFiles no + $ config config --local status.showUntrackedFiles no ``` 5. Checkout ```bash - config checkout + $ config checkout ``` #### Use submodules to sync other repos into dotfiles 1. Add a submodule to dotfiles ```bash - config submodule add https://github.com/user/dotfiles.git .path/to/dotfiles + $ config submodule add https://github.com/user/dotfiles.git .path/to/dotfiles ``` 2. Update submodules to sync to dotfiles ```bash - config submodule update --init --recursive + $ config submodule update --init --recursive ``` 3. Config push ```bash - config push + $ config push ``` - - - ### Basic commands Intialize a git repository in the root of the folder. ```bash -git init +$ git init ``` See which files git knows exist. ```bash -git status +$ git status ``` Add a new file to the repo. ```bash -git add +$ git add ``` Create a commit with a message about the commit. ```bash -git commit -m +$ git commit -m ``` Push the changes/commits to our repo. ```bash -git push -u origin main +$ git push -u origin main ``` -- cgit v1.2.3