added section on removing files from remote but not working tree
This commit is contained in:
16
git.md
16
git.md
@@ -2,10 +2,13 @@
|
||||
|
||||
## Table of contents
|
||||
|
||||
<<<<<<< HEAD
|
||||
- [glossary](#glossary)
|
||||
- [terminology](#terminology)
|
||||
- [branches](#branches)
|
||||
- [create a branch](#create-a-branch)
|
||||
- [submodules](#submodules)
|
||||
- [removing files from index](#removing-files-from-index)
|
||||
- [philosophies](#philosophies)
|
||||
- [merge](#merge)
|
||||
- [rebase](#rebase)
|
||||
@@ -38,7 +41,7 @@ git switch <branch-name>
|
||||
## submodules
|
||||
|
||||
To fetch submodules of a cloned repository use:
|
||||
```bash
|
||||
```sh
|
||||
# do it manually
|
||||
git submodule init
|
||||
git submodule update
|
||||
@@ -51,6 +54,15 @@ git submodule update --init --recursive
|
||||
```
|
||||
|
||||
|
||||
## removing files from index
|
||||
|
||||
To remove files from index without deleting them on disk, use:
|
||||
```sh
|
||||
git rm --cached <file-name>
|
||||
```
|
||||
This is helpful if one accidentally committed autogenerated files.
|
||||
|
||||
|
||||
## philosophies
|
||||
|
||||
Important things to always remember:
|
||||
@@ -80,3 +92,5 @@ git rebase <target-branch>
|
||||
# proceeds after solving rebase conflict
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user