noob
noob

Reputation: 3811

fatal: Could not read from remote repository. Github error: failed to push some refs to

Trying to add a csv file which is big using Git bash. I have cloned the repository where it exists in my git bash too and it exists by name origin. However I am unable to push csv file into origin.

Code to push Filename.csv into my github. The below code works fine.

$ git push origin master
$ cd path_of_directory
$ git lfs install
$ git lfs track "*.csv"
$ git add Filename.csv
$ git commit -m "Filename.csv"
$git remote add origin 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'
$git remote
origin

Code with a problem

$ git push origin master
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Replacing origin with the https link gives below error:

$ git push 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git' master
--->ref master:: Error in git rev-list --stdin --objects --not --remotes=https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git --: exit status 128 fatal: bad object 3cc9272e299e6c7a9cbfe02b36060691f7f86b17

error: failed to push some refs to 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'

Upvotes: 2

Views: 1015

Answers (1)

noob
noob

Reputation: 3811

Following steps worked for me:

$git init
$git add .
$git commit -m 'message'
$git remote add origin 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'
$ git pull --rebase origin master
$ git push origin master

This worked for me

Upvotes: 2

Related Questions