blob: 7c7ee3bf50ebf7a01ff2f7c940b1a6c98bd892f0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
### Dotfiles
- Intialize git and create a folder named ~/.cfg
```bash
git init --bare $HOME/.cfg
```
- 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'
```
- Make sure to ignore the folder we're going use to clone.
```bash
echo ".cfg" >> .gitignore
```
- Set flag to not show untracked files
```bash
config config --local status.showUntrackedFiles no
```
- 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 submodule add https://github.com/user/repo.git .path/to/repo
config submodule update --remote --merge
- - -
### Basic commands
Intialize a git repository in the root of the folder.
```bash
git init
```
See which files git knows exist.
```bash
git status
```
Add a new file to the repo.
```bash
git add <file>
```
Create a commit with a message about the commit.
```bash
git commit -m <file>
```
Push the changes/commits to our repo.
```bash
git push -u origin main
```
|