![]() This is where your later push, in that comment, is failing: $ git push -u origin main Do those commits add on to their main? Or do those new commits just wipe out their existing commits, as found from their name main? If you tell your Git to do that, and they do have a main, they'll take a look at the commits you just sent. Your Git can ask their Git to set their main. But to do that you'd have to run a Git command you haven't run (yet). After that, they will have your commits, under their name master. If you tell your Git to do that, and they don't have a master, they'll generally say "OK!" and do it. Your Git can ask their Git to set their master. Your Git now asks their Git to set some of their branch names, to remember these new commits. They put them in a temporary quarantine area while they check out the rest of what you want to do. Then, your Git sends these commits to them. Your Git lists out your commit hash IDs, and theirs lists out theirs (with a lot of fancy algorithmic work to minimize this communication) so that your two Gits can agree which commits you have, that they don't, that your Git wants to send to them. Your Git and their Git have a conversation. When you use git push, you are telling your Git to call up some other Git, in this case over at GitHub ( origin =, per your comment). Nobody wants to remember this! □ So we use a name like master or main to remember it for us. For instance, 2283e0e9af55689215afa39c03beb2315ce18e83 is the hash ID for a commit in the Git repository for Git. The problem with the numbers is that they're incomprehensible and impossible for humans to deal with. If you have the number, that's all you really need: give that to Git and Git will find the commit, if you have it. Those commit numbers, or hash IDs, are the way Git really finds the commits. The branch names only matter for finding the commits after that, the names stop being important-which is why you're free to change them at any time. Branch names do matter, because branch names help us-and Git- find the commits. The ultimate problem here is that Git is not about branches. At the end, I'll suggest a few possibilities, but you must inspect both your commits, and the commits found in the repository over on GitHub. Unfortunately we can't give you this without more information from you. Hopefully, they will get it fixed and git remote operations will be fine again.I'm pretty sure you'd like a simple formula, do X then Y and it will all work. I mean I set up Visual Studio Code using snap, so probably it might have been updated in the background a few hours before then. My big guess is that it's a bug from Visual Studio Code from the last update that was made some few hours before then (See the screenshot that shows that a Release was done on the same day that I was having the issue). Git remote add origin Finally, I decided to try using my default Ubuntu terminal and it worked fine. I tried removing the remote repository and re-adding it using the below commands, but still no luck: git remote remove origin git clone I tried setting my credentials again using the below commands but still no luck: git config -global user.email config -global user.name "John King" I tried recloning the project and then running the git pull command but it did not work. ![]() I did not make any changes to my GitHub credentials, neither did I change anything in the project, but I run any git command to communicate with my remote branch like: git pull origin dev I started experiencing this issue on Visual Studio Code in Ubuntu 20.04 yesterday. You can unselect the setting git.terminalAuthentication to avoid the error message. If that still doesn't work, you can switch to an SSH URL: git remote set-url origin that means you have published your SSH public key in your Account settings.įor Visual Studio Code specifically, see also " git push: Missing or invalid credentials. You can update your credentials using the Git credential helper, as in here. You can double check those settings, and make sure that your proxy, if you have one, hasn't changed.Ĭheck the output of git config -global credential.helper.Īnd make sure the credentials are your GitHub user account, and a PAT (Personal Access token). Then, if it was working before, and if it wasn't asking for your username, it must be because you had stored your credentials (login/password) in a $HOME/.netrc file, as explained here. ![]() ![]() First, you can make sure to use the proper URL: git remote set-url origin
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |