-1

Win 10, using Git bash. Git version 2.32.0.windows.1. Researched similar/same topics, they didn't help.

I'm a new user of Git, trying to learn how to use it, never used version control systems before, and I don't have anyone fleshy to ask or show me.

I follow the tutorial and even understand what's going on so far, but the push to the remote repository takes forever and does nothing. Everything up to that point worked.

Tutorial I'm using: YouTube Link with timestamp

What I successfully managed to do: created my first local repo, created dummy test file (took a random script for PCB CAD program with a bit of text, doesn't matter I guess), learned to create a branch and commit stuff to local branches. My head is about to explode, but it works, and I understand it so far. But pushing to remote repo hangs without giving any hint or clue.

I did a bit of research and found this topic here on StackOverflow: link

I added --verbose to the push command, so now it looks like this:

$ git push -u --verbose origin main
Pushing to https://github.com/ellectroid/test_public_repository.git

And then it hangs forever. Highly uninformative.
Also, in the stackoverflow post in the link above someone talks about protocols. I tried http and https. No difference.

Then someone (goes by Azeez) said to ensure I'm authenticated on GitHub. Well, I'm logged in in the browser, although I don't understand how that is connected, but I'm logged in. And then in the same post they write some quote:

Select an authentication method for 'https://github.com/':

  1. Web browser (default)
  2. Personal access token option (enter for default):

I have zero clue what this is, I was never asked to authenticate anything in the bash, and I have no clue how to do it. The tutorial doesn't do it and everything works there out of the box.

I'm a 100% Git and GitHub noob, registered an account like half a year ago, but today is my first day of actually trying to use it, and I immediately get this in the face without any clue as to why and what to do, so I would appreciate if your reply explained what to do in detail. I just want to be able to push what I have in my local repo to the GitHub.

I'm not using any proxy or anything, if that matters.

If you need more information from me, please tell me what information and where do I get that information. As I said, I don't know anything about Git yet, but very much want to.

P.S. I'm aware about master and main branch names and accounted for it.

UPDATE

On the next day when I tried to push, a Git GUI popped up with openSSH in window title asking me for GitHub username. I entered my username, which was for some reason all with asterisks (never seen login written with asterisks), I entered my GitHub username "ellectroid" and got "Application error" window with text "Error: error writing "stdout": broken pipe". I opened detailed error message, it says:

    error writing "stdout": broken pipe
error writing "stdout": broken pipe
    while executing
"puts $::answer"
    (procedure "finish" line 14)
    invoked from within
"finish"
    invoked from within
".b.ok invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 24)
    invoked from within
"tk::ButtonUp .b.ok"
    (command bound to event)

UPDATE 2 After extensive googling I found what person in the comments was talking about. Turns out there is a file with the name "config" without extension in the hidden folder .git in my local repo (was it difficult to explain like this? Sorry, I said I'm noob, you could word it friendlier for noobs), so here are the contents of this "config" file:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://github.com/ellectroid/test_public_repository.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin2"]
    url = http://github.com/ellectroid/test_public_repository.git
    fetch = +refs/heads/*:refs/remotes/origin2/*

I tried origin2 to try with http instead of https. I still get error when authenticating on github in Git GUI OpenSSH window, where I enter my login with asterisks ("ellectroid") and it spews out broken pipe error like above.

UPDATE 3

Thanks to @VonC, who invited me to the chat, we figured out all I had to do is to push not from the Git Bash, but from Windows CMD. Then, when I push, it immediately prompted me to use Personal Access Token, which I already created. Also, I did it with admin rights. Later on I changed environment variable PATH to include path to bash, so I can just write "bash" in CMD and get fancy colors and stuff. Case closed.

Ilya
  • 992
  • 7
  • 14
  • How long is "forever"? (5 seconds? 5 minutes? 5 years?) What version of Git are you using? (run `git --version`) – torek Nov 16 '21 at 20:06
  • by "forever" I mean "forever". Yesterday it was once 1 hour until I aborted (multiple attempts, just left one hanging for that long). It was just doing nothing all that time. Will add git version in the question now – Ilya Nov 17 '21 at 09:04
  • I think I suddenly got a Git GUI window which asks for my GitHub username. Maybe that was the problem? Nothiing popped up yesterday. Will give my credentials in there now and see what happens – Ilya Nov 17 '21 at 09:30
  • Entered my login on github (elletroid), got "Error: error writing "stdout: broken pipe"". Will add full log message to the question – Ilya Nov 17 '21 at 09:32
  • Interesting, the login is going through Tcl/TK for some reason. I don't "do" Windows but it's my understanding that this isn't right. I'll leave it for some Git-for-Windows guru to answer, but I'll update your tags (I think you want git-for-windows here). – torek Nov 17 '21 at 19:08

1 Answers1

1

On Windows, try and push from the command-line (not from a GUI) to test if that would be working.

Make sure that, in a simple CMD:

  • git config credential.helper does return manager-core
  • git ls-remote https://github.com// triggers a popup where you can enter your GitHub user account name and your PAT (Personal Access Token that you need to create first)

Then try and git push from within your local repository folder.

From the discussion, this started to work with:

  • C:\Program Files\Git\bin, so you need to add it to the system PATH (it is where bash.exe is)
  • a CMD opened as Administrator
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1) I'm actually using Git Bash (cmd), not GUI. GUI is just installed, but I'm not using it 2) credential.helper returned manager-core 3) I haven't heard of PAT. I do get a popup window, but get a broken pipe error when enter login into the field with asterisks (why would login be a field with asterisks?). I will try to create PAT now, but I'm REALLY noob at this. Will report in a few minutes. Thank you for your time. – Ilya Nov 18 '21 at 10:56
  • Created PAT. What do I do with it now? Please in idiot-friendly language; _________________ I tried $ git ls-remote https://github.com fatal: repository 'https://github.com/' not found ________________ Then I tried git ls-remote https://github.com/ellectroid/test_public_repository.git (my repo) And command immediately executed, nothing happened. No popups. I can just write further commands. Still can't push - hangs forever. – Ilya Nov 18 '21 at 11:14
  • A minute later (after I cancelled push command already) popup appeared "Open SSH", "Username for https://github.com:", same field with asterisks that error "broken pipe" when I enter anything at all (or even nothing at all) – Ilya Nov 18 '21 at 11:18
  • Still found nowhere to enter PAT – Ilya Nov 18 '21 at 11:18
  • @Ilya What is you OS version (typing winver in a CMD) It looks like a .Net Framework 4.8 or more is missing. – VonC Nov 18 '21 at 13:36
  • Windows 10 Pro, Version 20H2, OS Build 19042.1348. As for .Net, I have no clue really. I'm a microcontroller programmer mainly, maybe I'm missing that thing. Will google/install it now, see what happens. – Ilya Nov 18 '21 at 13:56
  • Installed .NET Framework 4.8. Same thing. Pushing forever. Popup window with login only shows up after I abort the push. Same broken pipe error. – Ilya Nov 18 '21 at 14:19
  • @Ilya Did you try from a new CMD, or the same CMD as before? – VonC Nov 18 '21 at 14:21
  • I rebooted after installing .NET Framework. So that must count as new CMD. – Ilya Nov 18 '21 at 14:21
  • @Ilya OK. Can you try the push from a CMD (not from git bash) – VonC Nov 18 '21 at 14:23
  • I launched CMD with admin rights (clicked on it before realized it was admin). And I got different result! "Select Authentication Method, 1, 2" (you probably know what it looks like). Can I ask why there is a difference? – Ilya Nov 18 '21 at 14:27
  • It asked me for token. I have the token (PAT), but I can't write it. It says "enter token", but doesn't react to keyboard – Ilya Nov 18 '21 at 14:29
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/239362/discussion-between-vonc-and-ilya). – VonC Nov 18 '21 at 14:31