Commit changes to new local branch, then:
git push -u origin new_branch_name
Commit changes to new local branch, then:
git push -u origin new_branch_name
From: https://medium.com/better-programming/how-to-remove-committed-files-from-git-version-control-b6533b8f9044
.gitignore
file, if you haven’t already.gitignore
to match the file/folder you want to ignoregit rm --cached path/to/file
--cached
flag should be used if you want to keep the local copy but remove it from the repository.git status
After completing these steps, those files should be removed from version control but not removed from any local machine. Any other developer which pulls again after you pushed your changes should have no issues.
Rename on Github first.
Then:
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
Assuming none pushed to origin.
git rebase -i HEAD~n
where n is number of recent commits to squash.
Vim will show commits from oldest to newest.
PICK the oldest (first line). SQUASH the subsequent commits.
Do a similar thing with Vim to edit the new commit message (interact, save, execute)