I accidentally added a large file to a git repo on a specific branch and had to change the commit history for the branch to remove the file with:
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
Now I see different SHAs for the commits on the branch I ran the command, which I am fine with, as the repo is fairly new and only I use it currently. But, when I checked the master branch and the other dev branch, I see the SHAs for the same commit are different. When I do a merge to dev or master (which I didn't do yet) wouldn't it fail? How can I rectify this issue?
The series of git commands that were executed:
git checkout -b move_branch master
add files from location1 commit
add files from location2 commit
add files from location3 commit
merge the master branch of an older repo which was added as a remote introducing some files including the big file commit
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
add files from location5 commit
add files from location6 commit
A--B--C master
\
X--Y--Z--A--B--C--D--E move_branch (Z is the commit with big file)
X--Y--I--J--K--L--M--N move_branch (after filter-branch)