Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot PUSH recent commits to Github that have been pushed to Bitbucket

I have two remote repositories. One is private (Bitbucket) and the other public (Github). I had been pushing changes to Bitbucket using Github app and then pushing the same commit to Github repo using Xcode. However, recently I have been unable to PUSH the commits to Github and using SourceTree I get this error message:

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.

This is how it looks from within SourceTree:

enter image description here

How can I get my Github repo to accept the most recent commits?

like image 702
Jonathan Avatar asked Nov 24 '15 01:11

Jonathan


3 Answers

You have a pre-push hook which is telling you that you have git-lfs (large file support) enabled for this repository, but that it can't find the git-lfs program on your computer. The solution is to either remove the hook (which is located in .git/hooks/pre-push, as the error message says), or to fix your PATH so that it can find the git-lfs program.

like image 60
db48x Avatar answered Oct 16 '22 11:10

db48x


It would have been enough to say that the .git directory is in the original local directory of your repository and you probably need a program like TextWrangler or similar, that shows the hidden files starting with a dot, to be able to see it and delete it by moving it to the trash (right click mouse). It took me one hour to figure out this. I hope no one else have to waste that time.

like image 1
Juan Presa Avatar answered Oct 16 '22 13:10

Juan Presa


Here is the instructions for removing the pre-push file using Mac Terminal: First: cd to the directory that is your local repository for your project. (The main folder that holds .xcodeproj and other files) The .git file is hidden but you can still access it by typing cd .git/hooks in terminal. If you type ls in terminal to view all files within the current directory, you'll notice the pre-push file. Type rm pre-push to remove the file. You should now be able to push to your remote repository. Just be sure to cd .. back a few times to your local directory for your project. Simple as that.

like image 1
Electric Avatar answered Oct 16 '22 12:10

Electric