PyCharm uses Git account from Credential Manager - windows

On my Windows 10 machine I need to have two Git accounts and I have no idea how to setup it. I have read about setting different values at different projects but my problem is slightly different. So I use Git in my Visual (Git extension for VS 2017 ; and my boss authenticated once ater cloning repo with his acc) and in PyCharm (build in version control).
When I want to push changes from Pycharm to my public Github repo I am getting error saying that my boss account is denied permission. And after deleting it from Credential Manager, I can push, pull everything.
After switching to Visual and doing something Git related, there is a entry added to Credential Manager.
And I am in loop. I need both things to work.

And I am in loop
Only if both remote repositories (the working one, and the public one) are both on GitHub.
Then the credential helper "manager" would only record one credential (username/password) for "github.com".
An alternative would be to use an SSH URL instead of an HTTPs one.
Then you could easily distinguish the credentials to use for each repository, as I mentioned in "How to set up authentication for two separate GitHub accounts from same ssh client?".

Related

Upload a project from one gitHub account to another

I have a project in one GitHub account and I want to upload it to another account without giving access to the first account and the first folder.
I could not find a normal upload option because the old GitHub account has already been embedded on the project.
I tried both Visual Studio and through CMD, maybe there is another option to do it?
Wait for an answer.
I did it: (GitHub instructions)
git remote add origin https://github.com/UserName/FolderName.git
and get
error: remote origin already exists.

Cloning a private Repo hangs for new 2.32.0.windows.1 version of git

Question:
Why does git-bash hang when cloning a non-public repo when installed with defaults?
Context:
I ran into this issue when trying to clone a private GitHub repo on my co-workers Windows 10 machine.
Steps to reproduce:
Installed the newest version of git bash for Windows (for at the time of writing this post for me was 2.32.0.windows.1). Choosing all of the defaults.
Run git clone [http-link-to-private-repo]
Expected:
A popup to enter username and password information.
My Hack Solution:
When installing 2.32.0. for windows check the "Enable experimental support for pseudo consoles.".
This allows the bash console to present you an option to authenticate via a web browser or a personal access token.
Unrelated Note:
I originally was looking to post this on the Github Issues page for Git but they don't have one so here I am. Not sure if this is the appropriate place to post this but I wanted it somewhere so another person doesn't run into the same trouble.
Many thanks this was the solution after everything else failed including setting up a new installation, a new access token, and trying to find faulty config files.
After updating my personal access token this behavior also occurred with git 2.28.0.
So i did an update to the newest git version and afterwards the above mentioned steps.
(Sorry, i can not make any comments directly.)
I also ran into this problem setting up my dev environment for a new work laptop... Thankfully I had an older Windows GitBash installer (2.31.1) so I ended up downgrading to the older version. Worked like a charm, for me but understand it may not be an option for everyone.

How to create a git repository on a shared windows machine which all developers can push to

I have created a bare Git repository on a shared windows machine on a local area network. I am experiencing a problem in which nobody else but me is able perform a push operation. When trying to sync with or push to the remote repository using the Visual Studio 2013 Git tools, other users receive an error reading "Opening repository: .The following errors were reported during push: refs/heads/master, Failed to rename lockfile to '/refs/heads/master': Access is denied." There seem to be a lot of similar questions about creating a shared repository on stack overflow though none of them have given me the right solution for my problem. One thought is that I may need to create a repository user group, perhaps based on our domain user groups, though I do not have any idea how to do this with Git on Windows and have not found any resources for instructions as of yet.
You can share the folder that contains the bare git repository, and just add those Windows users as people who can read and write to those folders. After making a folder "shared" Windows should tell you what the network path should be. Then it's a simple git clone file:////MACHINE_NAME/path/repo.git.

How do I set up Xcode source control so that my repository can be accessed by two MacBooks?

I have managed to set up Source Control locally on my MacBook (let's call it MacBook1) without any problems.
I would like to set up another MacBook (MacBook2) to access the same repository (the one stored locally on MacBook1). Basically I want both machines to be able to work on the same project at the same time and use MacBook1 as the Git repository and source control server (for lack of a better term).
I've tried clicking on my Wi-Fi status icon and Create Network, but when I do this I can no longer access the internet through Wi-Fi. Also my Git folder for my project is a hidden folder and I cannot seem to select it for sharing.
How can I share my MacBook1 local Git repository across 2 machines?
If you want to keep the repo private then use bitbucket.org, however if you want to make it public then use github.com.
I use bitbucket even though I only generally use one Mac for development as I figure their data handling standards are better than mine and I am less likely to lose data due to disk crashes etc.
You basically create an empty repo on bitbucket and then in your local working repo, do:
$ git remote add origin https://bitbucket.org/YourName/YourRepo.git
$ git push --all
$ git push --tags
(I am not associated with Atlassian).

How to push on GitHub from Visual Studio 2010?

I have installed GitExtensions and Git Source Control Provider Options.
But after committing whenever I am trying to push something to the repository. Nothing is getting pushed.
What is happening? I am not well-versed with Git. Any help would be great.
Here's a screenshot:
It looks like GitExtensions doesn't work quite well with HTTPS authentication. This authentication problem makes the push fails, since the remote doesn't recognize you and thus rejects the push.
I haven't verified by myself, but with recent Git versions you can use the Windows Credential Store for Git. This will allow to authenticate against Github's remote during the push.
GitHub mentions it in the documentation.
OK, there's a simpler solution to let authentication work correctly with GitHub without using the Windows Credential Store.
You can use the GitExtensions' GitHub plugin, which use OAuth token by connecting to GitHub.
In GitExtensions, go to Plugin menu -> Github. It opens a browser window, which lets you authenticate and give authorization to GitExtension. After this no password prompting!

Resources