Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

How to remove a file from commit

# if you want to just remove from latest commit
git rm -r --cached <file/dir>
  
# if you want to remove from all commit history
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
Comment

remove a file from git commit

git reset --soft HEAD^ 
or
git reset --soft HEAD~1
git reset HEAD path/to/unwanted_file
git commit -c ORIG_HEAD 
Comment

remove a file from a commit

git reset --soft HEAD^
git reset HEAD path/to/unwanted_file
git commit -c ORIG_HEAD
Comment

remove file from commit

$ git rm --cached <file>
Comment

PREVIOUS NEXT
Code Example
Shell :: install mongodb 
Shell :: git remove submodule keep files 
Shell :: read from .env file bash 
Shell :: how to check which shell 
Shell :: force remove a hidden folder in linux 
Shell :: git bash terminal weird characters 
Shell :: uninstall specific java openjdk ubuntu 
Shell :: push to github from terminal 
Shell :: linux remove link 
Shell :: copy file to ubuntu server 
Shell :: How to solve bad signature... index file corrupt 
Shell :: CMake Error at src/CMakeLists.txt:10 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. 
Shell :: powershell t admin 
Shell :: uninstall cinnamon 
Shell :: ssh with key 
Shell :: arch linux c# install 
Shell :: xrdp choose desktop environment 
Shell :: batch write file 
Shell :: install screen recorder linux 
Shell :: apt get update upgrade linux 
Shell :: install tree in centos 7 
Shell :: copy paste in git bash 
Shell :: how to format usb to fat32 ubuntu 
Shell :: how to print new line in shell script 
Shell :: ls permission 
Shell :: git abandon untracked files 
Shell :: How to allow permission to my new github account 
Shell :: set java home in ubuntu 
Shell :: install composer in ubuntu 
Shell :: speedtest cli 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =