Back

Explore Courses Blog Tutorials Interview Questions
+5 votes
2 views
in DevOps and Agile by (19.4k points)
edited by

I have been using Github for a little while and I have been fine with git add, git commit, and git push so far with no problems. Suddenly I am having an error that says:

fatal: Authentication Failed

In the terminal I cloned a repository, worked on a file and then I used git add to add the file to the commit log and when I did git commit, it worked fine. Finally, git push asks for username and password. I put those in correctly and every time I do this, it says the same error.

Does anyone have any idea what the cause of this problem is and how I can fix it?

The contents of .git/config are:

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

[remote "origin"]

        url = http://www.github.com/######/Random-Python-Tests

        fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]

        remote = origin

        merge = refs/heads/master

[user]

        name = #####

        email = ############

1 Answer

+5 votes
by (27.5k points)
edited by

In order to update the origin for your repository if set to https:

$ git remote -v 

$ git remote remove origin 

$ git remote add origin [email protected]:user/repo.git

For more commands like this please go through the following tutorial that will help you understand the git

 

Browse Categories

...