Answers for "git switch latest commit"

1

change last commit date

git commit --amend --date="Wed Feb 16 14:00 2011 +0100" --no-edit
Posted by: Guest on February-07-2022
5

git change commit

# for the most recent commit
git commit --amend -m "changed commits"
git push -f
# for n older commits
git rebase -i HEAD~n
# use r for reword to edit older commits
# removing a line means THAT COMMIT WILL BE LOST. 
git rebase --continue
# solve conflicts if exist
git push -f
# git push --force-with-lease origin <branch> is safer
Posted by: Guest on November-08-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language