From 10d386e06f5da52c046e31f3a484c2abfd219d9a Mon Sep 17 00:00:00 2001 From: zegonix Date: Sun, 8 Dec 2024 13:03:10 +0100 Subject: [PATCH] added section on removing files from remote but not working tree --- git.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/git.md b/git.md index 23a35a7..7102050 100644 --- a/git.md +++ b/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 ## 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 +``` +This is helpful if one accidentally committed autogenerated files. + + ## philosophies Important things to always remember: @@ -80,3 +92,5 @@ git rebase # proceeds after solving rebase conflict git rebase --continue ``` + +