Score:0

On Ubuntu, my WSL do add the changes which I made and also commits the changes but it do not push my changes to my Git repository

tn flag

Earlier, when I used to add, commit and then push my changes to my Git repository, my WSL used to ask me about my username and password, after which it successfully pushed all of my new files to my repository but since few days I am trying to push my required additions and commits to my Git repository but it gives me the following error git push origin main

/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe get: 1: /mnt/c/Program Files/Git/mingw64/bin/git-credential-manager-core.exe: not found

Username for 'https://github.com': Mamoona786

Password for 'https://[email protected]':

/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe store: 1: /mnt/c/Program Files/Git/mingw64/bin/git-credential-manager-core.exe: not found
To https://github.com/Mamoona786/my_first_website.git
 ! [rejected]        main -> main (fetch first)
error: failed to push some refs to 'https://github.com/Mamoona786/my_first_website.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ..') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Kindly help me how can I resolve my error?

muru avatar
us flag
The error is pretty clear: "Updates were rejected because the remote contains work that you do not have locally." and "You may want to first integrate the remote changes (e.g., 'git pull ..') before pushing again."
Mamoona avatar
tn flag
How can I resolve my error?
NotTheDr01ds avatar
vn flag
Welcome to Ask Ubuntu! This is more of a general `git` / development tool question (not anything to do with Ubuntu specifically), so you'll find [many questions and answers](https://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h) regarding how to resolve that message there. In general, the first thing to try is `git pull origin master` (or `main`, depending on the repo config). That's what @muru meant about the error being pretty clear - `git pull ..` is mentioned in the error message as being the likely solution.
NotTheDr01ds avatar
vn flag
I’m voting to close this question because it belongs on Stack Overflow (but it would likely be a duplicate there).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.