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 file from last commit git

git rm —-cached <file-to-remove>
git commit —-amend
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 :: search for ADS 
Shell :: ubuntu dot to png 
Shell :: git force push after reset 
Shell :: how to run a command async in ubuntu 
Shell :: oh my zsh git 
Shell :: writing to a text file in batch script 
Shell :: mac shell prompt 
Shell :: Push an existing repository to an empty github repository 
Shell :: ssh 
Shell :: sudo apt-get install jpeg 
Shell :: commit container to image 
Shell :: upgrade powershell 
Shell :: wget username and password 
Shell :: getting error while installing npm react-redux-form 
Shell :: arch linux sort packages by size 
Shell :: android studio git 
Shell :: copy everything vim 
Shell :: get last 10 lines of log 
Shell :: docker set container name 
Shell :: grep show lines between matches 
Shell :: libssl-dev ubuntu get version 
Shell :: ipnyb to ppt 
Shell :: kubectl apply 
Shell :: oh-my-posh autosuggestions 
Shell :: Got socket error trying to find package cupertino_icons at https://pub.dartlang.org. 
Shell :: material-ui 
Shell :: react ToastContainer 
Shell :: Create Flask Virtual Environments 
Shell :: shell list files in directory 
Shell :: docker copy file not found 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =