unable to fetch and pull
Prerequisites
- [x] Put an X between the brackets on this line if you have done all of the following:
- [x] Reproduced the problem in Safe Mode: https://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode
- [x] Followed all applicable steps in the debugging guide: https://flight-manual.atom.io/hacking-atom/sections/debugging/
- [x] Checked the FAQs on the message board for common solutions: https://discuss.atom.io/c/faq and posted mine also https://discuss.atom.io/t/unable-to-push-pull-from-atom/73376
- [x] Checked that your issue isn't already filed: https://github.com/issues?utf8=✓&q=is%3Aissue+user%3Aatom, checked https://github.com/atom/github/issues/1646
- [x] Checked that there is not already an Atom package that provides the described functionality: https://atom.io/packages, I am using core github package of atomio
Description
When I try to fetch / pull through atom (1.45.0) on my machine (Ubuntu 16.06), it says fatal: Couldn't find remote ref refs/heads/pentdev but git fetch and git pull works fine on cli
Steps to Reproduce
- Clone a git repo on machine from cli
- Open repo in atom IDE
- Press git fetch button from git pane on the right side
Expected behavior:
Fetch and pull commands should work properly
Actual behavior: Unable to fetch and pull
It throws above mentioned error
Reproduces how often: Reproduces Everytime
100%
Versions
Atom : 1.45.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0
Additional Information
Having the exact same problem.
sam eissue
I'm having this issue as well. Everything works fine through Terminal but when I try fetching through Atom I receive the "fatal: Couldn't find remote ref refs/heads/xxx" error.
The Github plugin works perfectly fine on the Windows machine. It is completely broken on Mac. I can't perform Github operation like fetch, pull, push on any repo. Works on the CLI though.
I spent a bit of time trying to debug this with @rahulsps in Slack before asking him to open this issue and tbh I'm a bit stumped. I also can't reproduce. Since there are a number of you experiencing this now, can you confirm a few assumptions for me?
- What Atom versions and OSes are all of you using?
- Are you all attempting to fetch HTTPS remotes?
- Is the repository you're attempting to fetch a private repository?
- Are you authenticating with the OAuth token? (If you use any git credential caching or helpers outside of Atom, Atom will prefer those. So: When you try to fetch with Terminal, are you prompted every time for your username and password?)
My best guesses based on the information I have so far is that this could be related to (a) a upgrade of the bundled git that happened in a recent Atom update, or (b) some change in GitHub's oauth scopes and permissions related to git operations that I haven't followed.
Spare time to bugfix here has been scant recently, so I don't know how soon I'll be able to try to take a deeper look again. Hopefully I'll get a few minutes this weekend?
I was having this issue on a different computer earlier this week, running Atom 1.45.0, and OS X 10.15.4. I upgraded my laptop this week (I no longer have the old one), and am no longer having this issue.
The old Macbook I had upgraded from Mojave to Catalina. I was on an older version of Atom and didn't have this issue, but when I tried to upgrade Atom from the menu bar, it gave me an error telling me that Atom was installed on a read only volume. Reinstalling Atom fixed the first issue, but gave me this one.
Same issue here, I can't pull/fetch without getting the error "fatal: Couldn't find remote ref master" but git cli works just fine. However, pushing via Atom does work.
I can confirm everything also works fine on my Ubuntu (19.10) box running the same Atom version.
I'm fetching from GitHub via https and I'm pretty sure I'm using OAuth since I'm not prompted for credentials from the command line every time and Atom never prompted me for credentials.
Atom: 1.45.0 x64 Electron: 4.2.7 Chrome: 69.0.3497.128 Node: v10.11.0 MacOS: Catalina 10.15.4
Oh - A quick way we could narrow it down to a token problem. Can one of you visit https://github.atom.io/login and use the token copied from there as your password when you fetch? Let's see if you the same problem or not.
Logged in to GitHub using the token. Tried both fetching and pulling. Getting a slightly different error, but along the same lines: "fatal: Couldn't find remote ref refs/heads/master". Using the Git tab instead of the GitHub tab I still get "fatal: Couldn't find remote ref master".
Verified pull still works without issue via CLI.
No, try using that token instead of your password on the command line. (Sorry, brain is fried and I totally didn't mention that in my question 😂 )
Piling on... tried the token via CLI and received the same error as trying to fetch in Atom: "remote: Repository not found. fatal: repository 'https://github.com/myOrg/myRepo.git/' not found" (org & repo changed, of course)
OS: Linux Mint 18.3 x64 Atom : 1.43.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0
Repo is private, accessing over https with no OAuth (entering credentials via CLI every time; works fine). Also, no credential caching or helpers outside Atom.
OK, so make sure I did this right since I'm NOT a git expert. I deleted the local directory and cleared my cached credentials. I re-cloned the repo and instead of using the username/password used the token.
That worked without any issue. Cloned the repo without error and git pull via CLI still works just fine without error. Atom still gives the same errors previously. I can also still push via Atom without issue.
Did I do that right and does that help?
Piling on... tried the token via CLI and received the same error as trying to fetch in Atom
Ahhh so it is a token issue. Now I just have to figure out why my token is fetching from private repos fine, but none of yours are... ?
Can one of you try this?
curl -s -I -u ${GITHUB_USERNAME}:${ATOM_IO_TOKEN} https://api.github.com | grep X-OAuth-Scopes:
For reference, mine shows the following:
X-OAuth-Scopes: read:org, repo, user:email
The token appears to work fine for me via CLI. I ran the code above and this is the result.
X-OAuth-Scopes: read:org, repo, user:email
My output:
X-OAuth-Scopes: read:org, repo, user:email
Wait - @nicktramp, your CLI output is different: it says "repository not found," not "Couldn't find remote ref."
Do you use multiple GitHub accounts? Are you sure your token was generated with the correct user? You can check like so:
curl -u ${GITHUB_USER}:${ATOM_IO_TOKEN} -s https://api.github.com/user | grep login
Just the one account. Tried a fetch on other private repos outside the org from Atom with success; all those tested that belong to the org are failing. Could the tokens have some permissions incorrectly set? I'm an admin of each repo I've tried, and org owner. If it's relevant, I switched to using ssh on the first-mentioned repo (rather than https) by git remote set-url on CLI, then fetch works fine in Atom. I also have to admit I don't know the workings of how the tokens are used by Atom, so I'm at risk of becoming useless for this issue. However, just mention me and I'll test whatever you need to help fill in the picture.
Wow; I feel dumb. For my case, I simply didn't grant org access to the Atom GitHub package for the org. Sorry for the confusion.
Oh! Yeah, that'll do it. No worries... that's a point of friction we never really found a good answer for.
@smashwilson
root@user-HP:/var/www/html/# curl -u ${rahulsps}:${token} -s https://api.github.com/user | grep login
root@user-HP:/var/www/html/# curl -s -I -u ${rahulsps}:${token} https://api.github.com | grep X-OAuth-Scopes:
Prints nothing at all
@rahulsps: Did you set the environment variables rahulsps and token to your username and token, respectively? What are the full responses (without the | grep ... parts)? Did you confirm that you see the same error when you use your token in place of your password with running git fetch on the command-line?
(Since @nicktramp's problem turned out to be org permissions, and their error message was different, we have not yet confirmed that it's the token which is causing problems.)
atom used to work fine till march 2020, after that something has happened and there is definitely some changes in scope because an alert also used to appear which i overlooked then and without grep it says
bash: ${rahulsps}:${token}: bad substitution
@smashwilson when i try to clone a repo using this token it works
atom used to work fine till march 2020, after that something has happened and there is definitely some changes in scope because an alert also used to appear which i overlooked then
That's strange, because we haven't changed the scopes on that token since 2018, when I was working on this full-time.
You ignored an alert about the token? In Atom? Have you tried logging out (by running GitHub: Logout from the command palette) and logging back in with a new token that has the correct OAuth scopes?
and without grep it says
bash: ${rahulsps}:${token}: bad substitution
Okay, that's because you aren't actually setting those environment variables anywhere. I can't give you a command that you can copy and paste without any changes because I don't (and shouldn't) know your token. I was implying that you should substitute your real token and username, either by setting them as environment variables in your shell or just substituting them directly.
What you actually need to do is:
$ export GITHUB_USERNAME=rahulsps
$ export ATOM_IO_TOKEN=.... # Paste the token that you copy from https://github.atom.io/login here exactly
$ curl -s -I -u ${GITHUB_USERNAME}:${ATOM_IO_TOKEN} https://api.github.com | grep X-OAuth-Scopes:
$ curl -u ${GITHUB_USER}:${ATOM_IO_TOKEN} -s https://api.github.com/user | grep login
@smashwilson when i try to clone a repo using this token it works
This implies that the token isn't the problem, though?
I am facing the same problem Os : Fedora 32 git version 2.26.2
Atom: 1.45.0 Electron: 4.2.7 Chrome: 69.0.3497.128 Node: 10.11.0
Worked very well until Friday ( I upgrade from Fedora 31 to 32 this week-end, coincidence ?) and today no more push or pull on all repositories !
with message
/bin/sh: erreur lors de l'importation de la définition de fonction pour « module »
/bin/sh: scl: ligne 1: erreur de syntaxe : fin de fichier prématurée
/bin/sh: erreur lors de l'importation de la définition de fonction pour « scl »
fatal: Couldn't find remote ref refs/heads/master"
i logout and login atom from github On Github i revoke access and re-enable access
curl -u ${GITHUB_USER}:${ATOM_IO_TOKEN} -s https://api.github.com/user | grep login
"login": "jfdumont"
curl -s -I -u ${GITHUB_USERNAME}:${ATOM_IO_TOKEN} https://api.github.com | grep X-OAuth-Scopes:
X-OAuth-Scopes: read:org, repo, user:email
I confirme i can git pull and push using cli
yes i have having a simillar problem, so everything working fine except when it is trying to push or pull the url it is trying to pull from is something like github.com/username/repo.git/ when its supposed to be github.com/username/repo.git
I started getting this issue recently too.
macOS: 10.15.5 (19F96) Atom : 1.47.0 Electron: 5.0.13 Chrome : 73.0.3683.121 Node : 12.0.0
When I run atom with:
/Applications/Atom.app/Contents/MacOS/Atom
It constantly outputs:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Not sure if that's part of the issue.
I'm having this problem as well. Here's what I get with GIT_TRACE turned on (user/repo-specific bits have been replaced with generic <placeholders>):
Unable to fetch
11:29:54.223335 git.c:440 trace: built-in: git fetch origin refs/heads/master
11:29:54.239494 run-command.c:663 trace: run_command: GIT_DIR=.git git-remote-https origin https://github.com/<github-org>/<github-repo>.git
11:29:54.862694 run-command.c:663 trace: run_command: 'git credential-osxkeychain get'
11:29:54.882837 git.c:703 trace: exec: git-credential-osxkeychain get
11:29:54.884143 run-command.c:663 trace: run_command: git-credential-osxkeychain get
11:29:55.087290 run-command.c:663 trace: run_command: 'git credential-osxkeychain store'
11:29:55.095016 git.c:703 trace: exec: git-credential-osxkeychain store
11:29:55.095768 run-command.c:663 trace: run_command: git-credential-osxkeychain store
11:29:55.161205 run-command.c:663 trace: run_command: '/tmp/github-2020629-87092-1abtdxv.blwr/git-credential-atom.sh store'
git-credential-atom: working directory = <local-repo-path>
git-credential-atom: socket address = unix:/tmp/github-2020629-87092-1abtdxv.blwr/helper.sock
git-credential-atom: action = store
git-credential-atom: parsed from stdin: [protocol] = [https]
git-credential-atom: parsed from stdin: [host] = [github.com]
git-credential-atom: parsed from stdin: [username] = [<github-username>]
git-credential-atom: parsed from stdin: [password] = [******]
git-credential-atom: all input received: EOF from stdin
git-credential-atom: discover credential helpers from system git configuration
git-credential-atom: PATH = <path-env>
git-credential-atom: discovered system credential helpers: "osxkeychain"
git-credential-atom: attempting to run approve with user-configured credential helpers
git-credential-atom: GIT_ASKPASS =
git-credential-atom: SSH_ASKPASS =
git-credential-atom: arguments = -c credential.helper=osxkeychain credential approve
git-credential-atom: stdin =
protocol=https
host=github.com
username=<github-username>
password=*******
git-credential-atom: success
fatal: couldn't find remote ref refs/heads/master
Same issue, same messages. Worked perfectly on Debian Linux till July.... now work only on windows 10
Newer to all of this, just tinkering with some projects. Still having this issue on a fresh install of Ubuntu 20.10. Tested the token with both login and X-OAauth-Scopes: and even without any grep and with multiple tokens (get a new one ever time I load the page) and all are returning bad substitution errors. I think I've tried everything I can here, has anyone found a solution?