Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git remove all local commits

git reset --hard origin/<branch_name>
Comment

how to remove all commits in git

git checkout --orphan latest_branch
git add -A
git commit -am "commit message"
git branch -D main
git branch -m main
git push -f origin main
Comment

PREVIOUS NEXT
Code Example
::  
::  
Shell ::  
::  
::  
:: vim hangs 
::  
Shell ::  
::  
::  
::  
::  
Shell ::  
::  
::  
Shell ::  
:: git init at wrong folder 
Shell ::  
::  
::  
::  
::  
:: show users in sudo group 
:: how to change time zone in ubuntu 18.04 server 
::  
Shell ::  
Shell :: git delete last commit after push 
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
8+9 =