added section on removing files from remote but not working tree

This commit is contained in:
zegonix
2024-12-08 13:03:10 +01:00
parent b614238024
commit 10d386e06f

16
git.md
View File

@@ -2,10 +2,13 @@
## Table of contents ## Table of contents
<<<<<<< HEAD
- [glossary](#glossary) - [glossary](#glossary)
- [terminology](#terminology)
- [branches](#branches) - [branches](#branches)
- [create a branch](#create-a-branch) - [create a branch](#create-a-branch)
- [submodules](#submodules) - [submodules](#submodules)
- [removing files from index](#removing-files-from-index)
- [philosophies](#philosophies) - [philosophies](#philosophies)
- [merge](#merge) - [merge](#merge)
- [rebase](#rebase) - [rebase](#rebase)
@@ -38,7 +41,7 @@ git switch <branch-name>
## submodules ## submodules
To fetch submodules of a cloned repository use: To fetch submodules of a cloned repository use:
```bash ```sh
# do it manually # do it manually
git submodule init git submodule init
git submodule update 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 ## philosophies
Important things to always remember: Important things to always remember:
@@ -80,3 +92,5 @@ git rebase <target-branch>
# proceeds after solving rebase conflict # proceeds after solving rebase conflict
git rebase --continue git rebase --continue
``` ```