3

I wanted to push a few changes to my bitbucket repository. However, I forgot to pull the updated version first as some changes were done to it by another team-member. I got an error with the push command (using Jenkin deploy) that I should pull the changes first. At this point I had executed the following commands:

git add some files 
git commit -m "commit message"
Jenkin deploy # here I got the error

After the error message, I pulled the updated version from the master branch using git pull which resulted in a conflict. I resolved the conflict with my version in Pycharm (IDE, in my use). The conflict was with a version number. After that, I did another commit (merge commit).

git commit

However, now I cannot enter the src folder in my bitbucket. Nothing happens when I click on src folder. I cannot clone my repository. I can open the rest of the folders. I get a 500 error when I try to open the commit e3895f0 (in the below screenshot) which I executed before the pull command. For the rest of commits, I can open them. I can't figure this out. Either something is wrong on bitbucket side but I can open other folders or I broke something. Could it be that my commit was executed properly? As I ran git fsck and found one dangling blob item but not sure if that's going to help.

Update 1: In this specific commit before the merge, I committed a new bin file with a size of 3.6 GB. Could that be a reason for this chaos?

Update 2: I reverted all the changes and went to back an older commit just before this problematic commit. Now I clone the repository with from that older commit, however, I am still unable to access src folder.

Update 3: I did a hard reset by deleting all my commits since the problematic commit which solved the problem. Now I can access the src folder. I am aware that it's a dangerous approach, however, in this specific case, these new changes were not pulled by others.

git reset --hard thecommit-before-problematic-commit
git push -f

However, the question still remains, how can I efficiently use this huge file in my repository without causing this problem again? It's a 3.6GB Google word2vec model.

Here is my commit tree: The problematic commit can be seen in the screenshot (e3895f0 ).

BSMP
  • 4,596
  • 8
  • 33
  • 44
utengr
  • 3,225
  • 3
  • 29
  • 68
  • Does that 500 page include a UUID? – Jim Redmond Jul 25 '17 at 17:41
  • @JimRedmond Nope, it just says something went wrong. I get the error when I try to go the commit e3895f0 in the screenshot. I updated the question the error message. – utengr Jul 25 '17 at 18:03
  • @engr_s I recommend you use feature branches in the future to avoid this problem. Good luck on the solution. I'll try to help out as much as possible with an answer – Oxymoron Jul 25 '17 at 18:41
  • @Oxymoron okay, thanks. I will keep this in mind for the future. Just started using git so need some time to get a hang of it. – utengr Jul 25 '17 at 18:51
  • I'd contact their support team about this if I were you. – ChrisGPT was on strike Jul 25 '17 at 22:26
  • @Chris would do that tomorrow as I'll give it another try before contacting them. – utengr Jul 25 '17 at 22:33
  • Would it be a good idea to force commit all the files in this problematic directory? – utengr Jul 26 '17 at 10:06
  • 1
    `git` isn't intended to work well with binary files (especially large ones), and I'd definitely expect a 3.6Gb file to cause some trouble. – TriskalJM Jul 26 '17 at 13:15
  • @TriskalJM realized that a bit too late. For now, I want to just recover access to src folder so I can open it. From that point on, I will look at other options for this bigger file such as git LFS (large file system). – utengr Jul 26 '17 at 13:51
  • 1
    I'd recommend viewing the answers here: https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository – TriskalJM Jul 26 '17 at 13:56
  • 1
    Assuming that you have a local copy of this commit… remove the giant binary blob (`git rm blob.bin`), amend the commit to delete it (`git commit --amend`) and then force-push (`git push --force`) it to your Bitbucket remote. This should effectively cause Bitbucket to forget that the branch in question ever contained this giant binary blob. – Dan Lenski Jul 26 '17 at 14:02

1 Answers1

0

I did a hard reset by deleting all my commits since the problematic commit which solved the problem. Now I can access the src folder. I am aware that it's a dangerous approach, however, in this specific case, these new changes were not pulled by others.

git reset --hard thecommit-before-problematic-commit
git push -f
utengr
  • 3,225
  • 3
  • 29
  • 68