SourceTree keeps prompting for credentials for an old and unused remote source - atlassian-sourcetree

I pulled an old repo that has a submodule from e.g. stash.oldCompany.com/oldModule. I used to have credentials for it, but the entire thing was moved to a different public repo. I think the old repo still exists, but I sure don't have access there anymore.
Anyway, I entered vim .gitmodules and altered the submodule url to point at the public repo, and it works perfectly.
However - SourceTree still prompts me for credentials of the OLD url every single time I tab into SourceTree.
I don't have any repos that reference this URL anymore, directly or as submodule, yet it keeps prompting for credentials. Many people seem to be reporting similar behavior, and people keep suggesting entering SourceTree-settings and resetting the git-version, but I've tried that, but it still happens. That's a different problem anyway, because that's a prompt for logging into a repo they're actually using.
It feels like SourceTree is stuck in a loop of trying to authenticate me to a repo I accidentally attempted to pull as a submodule in a project that no longer utilize it. How do I get it out of this loop? It's driving me mad.

Related

Clone Git repository with personal access token

I just created a new Github repository, and as I was about to clone it to start pushing files I realized I no longer managed to pass the authentication step. I have tried pretty much every combination of solutions I could find on the Internet, starting with how I used to do it (git clone https://<PAT>#github.com/<username>/<repo name>), and nothing seems to work. I also tried the <username>:<PAT>#github.com or oauth2:<PAT>#github.com variants among other things. When trying to push, I either end up having to enter a password that's no longer supported and inevitably fails, or I get straight up told my username or password are invalid. I also regenerated the PAT so it's not an expiration issue.
I know this is quite similar to other questions on this site, but none of their answers worked for me. Did Git change their authentication system again recently?

When i push into github from vs code it shows me the wrong user even though i have signed in with the right account

I am having a issue every time I push code into GitHub:
I have this account
and this is what it shows after I do a commit:
This is a name or nickname I have never used, and this shows for private repositories and public repositories as well.
After doing some research, I have removed Windows credentials of GitHub and VSCode to make sure that the issue does not stand there:
It did not resolve the issue.
I have tried the command to remove all credentials and add them again, I added them again but the issue still persists.
For some reason, every time I make a commit, unless I upload directly the code from github.com, it will show it with the wrong user as push.
Credentials are use to authenticate to GitHub, which check if your account (identified by the credentials) has the right to access/push to your remote repository.
This has nothing to do with commit authorship, which is only set by a local git config --global user.name or user.email.
Check first those settings, adjust them (especially the email one), and make/push another commit, to confirm they are properly displayed (with the right account)

'Can't find' repo error - missing a repo and can't move past it

I'm new to git/github. A few months ago, I put an old wordpress site as a repo on there, that I've since deleted from my computer. Had alot of trouble since then with github. When I try and put a new repo on github, it won't let me, and says it's missing the original repo (see attached pic). I thought this might be a github issue for my account, so I tried creating a brand new github profile from scratch to bypass the error. But even logged into the new github (with no repos), I still get this error. It's like my computer is stuck on this git issue for this one old repo. I'm using a M1 macbook pro if that matters. Can anyone help?
I have a copy of the wordpress site that it was originally linked to, but it's a different version. I don't know if I need to put this in a specific location and that will make the error go away?

Safe way to rename GitHub repository to the name of one I just deleted?

I had 2 repos on Github: "RepoName" and "RepoName_old". I thought I was going to rebuild my project but changed my mind and have been improving "RepoName_old" ever since. I deleted "RepoName".
If I rename "RepoName_old" to "RepoName" (the deleted repository), will something go horribly wrong? The official documentation warns against trying to pull from a branch associated with the old name...I guess that's a different thing...will GitHub Desktop acknowledge the new name after I make the change?
I have terrible experience mismanaging my git repositories and I want to avoid another setback by being informed and careful.
GitHub Desktop is a local tool which should reflect the changes done on GitHub.
On GitHub side, if you have deleted RemoName, you should be able to rename "RepoName_old" to RepoName.
Check first that it works on github.com.
Then try and clone it in command line, and, with GitHub Desktop, add it from your local folder. That should force GitHub Desktop to recognize RepoName with its new origin URL.

How can I copy an git repository in Xcode to github?

Every time a try to use github I get tangled in a series of errors that seem to have no solution and I give up. This time I thought I'd try to get help.
I have a local repository created and managed with Xcode. All the local git functions in Xcode work with no problem. Now I want to put this project on github so others can see it. I logged into github and created a repository. It's this one:
lummis/CS193P-2015-Assignment-5
I added a .gitignore file but then deleted it again because I thought it was causing an error. I tried adding a readme file but wasn't able to. I got some error that didn't make sense to me so I gave up on that. So at this point the github repository is empty so far as I can tell.
My local repository has many commits and is currently up-to-date. IOW there is nothing to commit. But when I do "Source Code / Push" I get the following error:
Working copy out of date. Try pulling from the remote to get the
latest changes then push again.
So I try to do that in Xcode by doing "Source Control / Pull". But then I get this error:
"github/master" is not a valid remote branch to pull from. Please
choose a different remote branch.
But there is only one branch. There is no other branch (local or remote) to choose. So I'm stuck in a Xcode-github error loop again. I searched for information about this but didn't find anything relevant. I have the Pro Git book and read and understood it at least thru chapter 2. But that doesn't help on interacting with Xcode.
Can anybody say what I need to do? I thought of deleting the remote repository and starting over but apparently there's no way to do that either!
I know lots of people use github so it must work once you know how to use it but it's a big source of frustration for me.
You have a local repository with "many commits". Let's imagine that we have three:
A---B---C
^
master
Your remote repository on GitHub also contains commits, but they are different ones from what you have locally, e.g.
Y---Z
^
master
At least one of these remote commits was created through the GitHub web interface, which creates a new commit each time you use it.
Because the two repositories contain no common history, Git can't figure out how to handle a push from your local repository to the remote one. It will refuse to accept such a push rather than making any remote commits inaccessible, which is what you usually want.
In this case, commits Y and Z in the remote repository can be discarded. They simply add and then remove a .gitignore file, and you want the remote to reflect what you have locally. The solution is to force push.
Force pushing should generally be avoided, since it can cause commits to be discarded (like Y and Z will be in this case) or to have their hashes changed, which causes major problems with shared repositories. In this instance I don't see any danger in force pushing, which can be accomplished with the -f or --force argument to git push.
(There's nothing fundamentally wrong with force pushing, and in some situations it makes perfect sense, but it should be done with care for the reasons listed above.)