why does vscode intercepts git push command on terminal? - github

Today I was going to execute git push from the vscode terminal and a dialog popup saying:
extension 'GitHub' wants to sign in using GitHub.
I've checked and turns out that I don't have any extension called GitHub installed on vscode.
The question is why this is showing for me? If I wanted to push using an extension I would not typing on terminal git push. Is vscode intercepting what I type in terminal?
Besides that it also opens a user/password dialog like this:
This is invasive. Is there any way to disable this?
PS: I already uncheck GitHub Authentication from Settings:
I'm using vscode for one year and this is the first thing that annoyed me. I like vscode very much and I don't want it to became an IDE. Features like this should be incremented by extentions.
PS2: I'm using vscode 1.50.0

This behaviour is built into VS Code, so you will see this prompt even if you do not have a GitHub extension installed:
Enabling authentication through GitHub happens when you run any Git
action in VS Code that requires GitHub authentication, such as pushing
to a repository that you're a member of or cloning a private
repository. You don't need to have any special extensions installed
for authentication; it is built into VS Code so that you can
efficiently manage your repository.
When you do something that requires GitHub authentication, you'll see
a prompt to sign in
You can use a separate Windows command prompt to avoid VS Code intercepting your commands.
EDIT If you prefer to use VS Code terminal for git commands without the interception, then as HolyBlackCat helpfully points out, there is now a setting to disable this behaviour.
"github.gitAuthentication": false,
Any git authentication prompts will then occur outside VS Code.

Related

How to open your own github repo from github.dev

In the new product of Microsoft, github.dev, you are automatically forwarded to a VSCode web IDE. However, I am not sure if it is possible to open your own repo (hosted on github.com), work on it and push the changes. Can you help explain if this can be done and how?
I do not seem to find a straightforward tutorial on that.
Note that I was able to open a repo of mine by clicking on the blue GitHub icon in the bottom left corner, but I fail to install a terminal, because
Terminals are not available for web editor. To use terminal you need to continue working in an environment that can run code, like codespaces or local VS Code
I read that codespaces are a paid option for github enterprise, but the way this error message is written might suggest other ways.
Opening your repository
You can open your repository by visiting it's page on GitHub and pressing . to open it in github.dev. You can also use the url format https://github.dev/<username>/<repo-name> with the path to your repository.
Making Commits
While the terminal cannot be used in the editor, you can make commits using the VSCode source control system.

Connection to Github from VS code fails

I am trying to connect VS code (on win10 machine) to github.
The GitHub Pull Requests and Issues is installed and enabled.
I followed few YouTube guides in which it was mentioned the git button that should appear on the upper right side of the explorer window, in order to add the project to the source control section.
This button doesn't appear at all.
Any idea?
Thank you
Since I post this message, VScode released a new version which makes the connection to Github very simple. For newbies like me that need to establish the connection, you may use the process I use:
1- Create a repository on github, and copy the link to the repo
2- In VScode, in view, command palette: GitClone, then add the link you just copied, select the folder where you want to store the repo on your local drive, and that's it.
3- Use the Source Control button on right, and them stage your changes, commit - and now only push/pull or sync.
Good luck.

GitHub can't connect to IntelliJ after updating to 2017.3.3

I've just tried to update my IntelliJ to version 2017.3.3 and I can no longer fetch or pull into my GitHub repos. It will first prompt me with this screen:
Then, I will correctly enter my credentials, after which it will prompt me with this one:
And then it will go back and forth between those two, with me correctly entering my credentials, until finally it alerts me with:
I've checked through a browser, I'm able to log in and out of Git with the credentials I'm using in Intellij. I've also checked in IntelliJ File | Settings | Version Control | GitHub and running a test, having it prompt me for the two factor authentication. That returns a success from IntelliJ. Any idea on what's going on? Thanks!
https://github.com/Microsoft/Git-Credential-Manager-for-Windows
"NOTICE: Experiencing GitHub push/fetch problems?
As of 22 Feb 2018, GitHub has disabled support for weak encryption which means many users will suddenly find themselves unable to authenticate using a Git for Windows which (impacts versions older than v2.16.0). DO NOT PANIC, there's a fix. Update Git for Windows to the latest (or at least v2.16.0)."
You need to update the Git Credentials Manager and possibly Git itself.
Looks like the second prompt is issued by the credential-helper configured in the git client itself. Does git fetch work from the command line?
I would recommend unsetting all gi credential helpers and let IntelliJ manage your passwords. See e.g. this thread to unset them

Can't commit with Github Windows, no reason given

I have been forced to use other apps, and the command line since Github for Windows is not allowing me to commit changes. I would like to understand what's the problem, but I simply get a prompt with this message:
Commit failed
Failed to create new commit
Then, it gives me the option of go to the Git Shell or to cancel. While I am not an expert with the terminal, I am able to make commits when I choose to go to the Git Shell (or to any other application for that matter).
I am using Github 2.0.5 on Windows 7.
After an exchange with the Github for Windows developers, the issue has something to do with Windows inability to work with paths when they're too long. The node_modules folders generated by Node.js is the culprit of this issue in my particular case.
However, the node_modules folders in my repository are gitignored. The fact that even when gitignored they create a problem in Github for Windows means the developers have to address the situation.
I expect a response or a patch from the developers soon. They have been very helpful. In the meantime, I am using SourceTree as my Windows Git GUI.

Do you have to install Git separately from GitHub for Mac?

I am a novice coder and I write a blog about learning to program aimed at journalists.
Learning the basics of how to use a version control system was one of the best things I learned this year, and I am now writing a tutorial about it.
Here is my question:
Do you have to install Git separately from Github's graphical client, GitHub for Mac? If it's possible to avoid command-line operations, I may choose to write the tutorial just focusing on downloading and installing GitHub for Mac and walking the user through the process of making new repos, forking, rolling back, etc.
Yes, if you want to do any git stuff on the command line, you'll need to install it. You'll especially want to do it because Github for Mac doesn't let you do everything you need to out of the box. For example you can't do a push without commit everything which can be annoying if you need to push a feature quickly without branching. Also, it is good for learnings!
You'll find an easy shortcut to install it under the "Github" menu: "Install Command Line Utility..."
You now can, (May 2013) install git directly from "GitHub for Mac"
See the blog "Installing Git from GitHub for Mac", you can install only the GUI, or the GUI and a regular git CLI (Command-Line Interface)
you can now easily install Git for use on the command line, without needing to download any separate packages.
When there is a new release of git, you don't have to do anything:
And whenever we update the version of Git included with GitHub for Mac, you'll get the changes automatically – no work required on your part!
There is a new "Advanced" option:
you may notice some changes to the Preferences window.
On the newly renamed "Advanced" tab, simply click "Install Command Line Tools".
You'll be prompted for an administrator password so that Git can be installed into /usr/local/bin, and then you should very shortly see that it succeeded: