desktop: GitHub wiki repos not detected correctly, asks user to publish again

Description

After clone a wiki repository and close GithubDesktop can no longer identify the origin.

Version

GitHub Desktop version: 1.0.12 and 1.0.13

git rev-parse HEAD: 372c2548553eac84ceef398fa0326c5815c919cc

OS version: Microsoft Windows [version 6.3.9600]

Steps to Reproduce

  1. Clone a wiki repository
  2. Close and reopen GithubDesktop
  3. Edit any file
  4. Commit
  5. Click in “Push origin”

Expected behavior: push to origin

Actual behavior: after close and reopen settings are losing, but after click in “push to origin” is failed and is showed this window:

Actual behavior

Reproduces how often: Whenever the GithubDesktop is closed.

Logs

2018-01-22T02:23:25.457Z - info: [ui] [AppStore] loading 15 repositories from store
2018-01-22T02:23:25.509Z - info: [ui] [AppStore] found account: brcontainer (Guilherme Nascimento)
2018-01-22T02:23:29.801Z - info: [ui] Executing getStatus: git status --untracked-files=all --branch --porcelain=2 -z (took 4.434s)
2018-01-22T02:23:29.851Z - info: [ui] Executing getRecentBranches: git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 -- (took 4.319s)
2018-01-22T02:23:29.851Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%1F refs/heads refs/remotes (took 4.325s)
2018-01-22T02:23:30.975Z - info: [ui] launching: 1.0.12 (Windows 6.3.9600)
2018-01-22T02:23:36.013Z - info: [ui] Executing installGlobalLFSFilter: git lfs install --skip-repo (took 5.319s)
2018-01-22T02:23:46.656Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 4.006s)
2018-01-22T02:29:46.275Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 1.870s)
2018-01-22T02:31:55.916Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:35:28.062Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:35:28.065Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:41:10.556Z - info: [main] Received possible protocol arguments: 4
2018-01-22T02:41:10.561Z - info: [main] Processing protocol url
2018-01-22T02:41:24.390Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:41:24.392Z - info: [ui] [AppStore.getAccountForRemoteURL] account found for remote: https://github.com/inphinit/inphinit.wiki.git - brcontainer (has token)
2018-01-22T02:41:28.905Z - info: [ui] Executing clone: git -c credential.helper= clone --recursive --progress -- https://github.com/inphinit/inphinit.wiki.git C:\Users\Latitude E6410\Documents\GitHub\inphinit.wiki (took 4.355s)
2018-01-22T02:41:28.952Z - info: [ui] [AppStore] adding repository at C:\Users\Latitude E6410\Documents\GitHub\inphinit.wiki to store
2018-01-22T02:41:29.637Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:41:30.064Z - info: [ui] Executing isUsingLFS: git lfs track (took 1.036s)
2018-01-22T02:41:30.998Z - warn: [ui] Unable to fetch issues for inphinit/inphinit.wiki
Error: Cannot get issues for a repository that hasn't been inserted into the database!
    at Object.n [as fatalError] (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\external "path":1:1)
    at t.IssuesStore.getLatestUpdatedAt (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\stores\issues-store.ts:29:24)
    at t.IssuesStore.fetchIssues (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\stores\issues-store.ts:66:5)
    at oe._updateIssues (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\stores\app-store.ts:830:6)
    at oe._selectRepository (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\stores\app-store.ts:799:5)
    at t.Dispatcher.selectRepository (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\dispatcher\dispatcher.ts:167:4)
    at appStore._completeOpenInDesktop (C:\Users\Latitude E6410\AppData\Local\GitHubDesktop\app-1.0.12\webpack:\app\src\lib\dispatcher\dispatcher.ts:390:13)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:109:7)
2018-01-22T02:41:31.389Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:13.909Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:42:17.395Z - info: [ui] Executing push: git -c credential.helper= push origin master:master --progress (took 3.459s)
2018-01-22T02:42:24.142Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:27.256Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:27.256Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:42:28.791Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:28.791Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:42:29.326Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:29.327Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:42:29.827Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:42:29.827Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)
2018-01-22T02:50:16.035Z - info: [ui] [AppStore] loading 15 repositories from store
2018-01-22T02:50:16.040Z - info: [ui] [AppStore] found account: brcontainer (Guilherme Nascimento)
2018-01-22T02:50:16.873Z - info: [ui] launching: 1.0.12 (Windows 6.3.9600)
2018-01-22T02:50:17.609Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:58:33.848Z - warn: [ui] fetchRepository: 'inphinit/inphinit.wiki' returned a 404
2018-01-22T02:58:33.852Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: inphinit.wiki - brcontainer (has token)

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 18
  • Comments: 57 (3 by maintainers)

Most upvoted comments

sad that this has been in backlog for 4 years

Same problem

image

same issue here - don’t want to move to another application etc… any hope this will be fixed?

Same problem

image

Same issue as @Rauschii and others above for me in GitHub Desktop v2.9.3 (x64)

“Can’t find repository matching {myorg}/{myrepo}.wiki.git”

And yet I can clone using command line git using the same.

Any news on when this will be fixed?

It would be nice to be able to use Github Desktop to work with a repo’s wiki directly. I hope this is addressed at some point.

More research is needed, but in my environment, a git push from GitHub Desktop to a cloned wiki is always successful.

Steps I took

This is the target example repo: https://github.com/KEINOS/wiki-test/wiki

  1. Create a newly public repo and copy the URL of the wiki repo from “Clone this wiki locally” link.
  2. In the local working dir, clone the repo with git clone.
    • E.g. $ git clone https://github.com/KEINOS/wiki-test.wiki.git
  3. Move to the cloned repo and copy the full path.
  4. Open the cloned repo with GitHub Desktop by $ github ..
  5. “Add Local Repository” dialog appears then paste the full path and press “Add repository”.
  6. Edit the file (wiki page).
  7. In GitHub Desktop, “Commit to master” the changes and “Push to origin”.
  8. View the changes of wiki in GitHub.

My guess

As you can see, apart from cloning the wiki repository with the git clone command, all operations such as add, commit and push are performed from the GitHub Desktop GUI.

My guess is:

  1. Whether or not the env variable of GITHUB_TOKEN is set.
  2. Whether or not the conf of url.<base>.pushInsteadOf is set.

GITHUB_TOKEN

This is the log of a successful attempt (the git push command). Note, however, that attempts to access the GitHub API fail with a 404 error.

スクリーンショット 2022-11-29 11 07 46
Full log of the above
install.ts:28 [AppStore.withAuthenticatingUser] account found for repository: wiki-test.wiki - KEINOS (has token)
install.ts:28 Executing push: git -c credential.helper= push origin master:master --progress (took 2.374s)
http.ts:152          GET https://api.github.com/repos/KEINOS/wiki-test.wiki/branches/master/push_control 404
Mt @ http.ts:152
request @ api.ts:1401
fetchPushControl @ api.ts:1319
refreshBranchProtectionState @ app-store.ts:1099
f.performFailableOperation.retryAction @ app-store.ts:4189
await in f.performFailableOperation.retryAction (async)
processTicksAndRejections @ node:internal/process/task_queues:96
await in processTicksAndRejections (async)
performFailableOperation @ git-store.ts:912
(anonymous) @ app-store.ts:4135
withPushPullFetch @ app-store.ts:4253
performPush @ app-store.ts:4049
(anonymous) @ app-store.ts:4029
withAuthenticatingUser @ app-store.ts:5703
_push @ app-store.ts:4028
push @ dispatcher.ts:689
push @ push-pull-button.tsx:302
onClick @ button.tsx:144
onClick @ button.tsx:156
l @ react-dom.production.min.js:14
f @ react-dom.production.min.js:15
(anonymous) @ react-dom.production.min.js:15
R @ react-dom.production.min.js:17
A @ react-dom.production.min.js:18
_ @ react-dom.production.min.js:18
M @ react-dom.production.min.js:21
xn @ react-dom.production.min.js:84
Ta @ react-dom.production.min.js:250
Le @ react-dom.production.min.js:39
An @ react-dom.production.min.js:86
(anonymous) @ react-dom.production.min.js:251
t.unstable_runWithPriority @ scheduler.production.min.js:18
Da @ react-dom.production.min.js:251
Dn @ react-dom.production.min.js:85
install.ts:28 [fetchPushControl] unable to check if branch is potentially pushable
Error: Not Found
    at Ot (/webpack:/[name]/app/src/lib/http.ts:178:11)
    at Sn.fetchPushControl (/webpack:/[name]/app/src/lib/api.ts:1322:7)
    at or.refreshBranchProtectionState (/webpack:/[name]/app/src/lib/stores/app-store.ts:1100:39)
    at f.performFailableOperation.retryAction (/webpack:/[name]/app/src/lib/stores/app-store.ts:4184:45)
    at ys.performFailableOperation (/webpack:/[name]/app/src/lib/stores/git-store.ts:913:7)
    at /webpack:/[name]/app/src/lib/stores/app-store.ts:4134:49
    at or.withPushPullFetch (/webpack:/[name]/app/src/lib/stores/app-store.ts:4252:5)

This means that GitHub Desktop treats the wiki like a GitHub repository. However, it does not provide the required API. So it is a normal Git repository.

Note the first line in the log “account found for repository: wiki-test.wiki - KEINOS (has token)”. This could be the key to a successful git push.

Due to the use of 2FA, I’m setting a personal access token in my environment variable GITHUB_TOKEN. This was the first thing I thought to take into account.

pushinsteadOf(url.<base>.pushInsteadOf)

Another is the push URL.

$ git remote -v
origin	https://github.com/KEINOS/wiki-test.wiki.git (fetch)
origin	git@github.com:KEINOS/wiki-test.wiki.git (push)

Note that the remote URL on push is set to SSH and not HTTP. Even we cloned via git cloned https://github.com/....

This is due to the unified push behavior when cloning repos via SSH or HTTP by globally configuring the url.<base>.pushInsteadOf option. (See the line at url.git@github.com:.pushinsteadof=https://github.com/)

$ git config --global --list
core.excludesfile=~/.gitignore_global
core.quotepath=false
core.ignorecase=false
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
user.name=KEINOS
user.email=**snip**
user.signingkey=**snip**
url.git@github.com:.pushinsteadof=https://github.com/
gpg.program=/usr/local/bin/gpg
commit.gpgsign=true
credential.helper=osxkeychain
init.defaultbranch=main

Hope this information is useful to someone.


  • Env info
    • GitHub Desktop: Version 3.1.2 (x64)
    • git: git version 2.38.1
    • macOS Monterey (OSX 12.6.1, 21G217)

Any chance this bug could get upgraded to a higher priority level? It is one of the top 10 most commented on open issues in this repo. And the wiki feature is difficult to use without this fix. @shiftkey @tierninho @billygriffin

This is still an issue in version 2.2.4 of GitHub Desktop for Windows. It might be kinda helpful if the relevant menu options (i.e. push/pull) were greyed-out for wiki repos.

Thanks for the instructions @KEINOS

Instead of pressing the “Push Origin” button, go to the terminal/console $ cd /path/to/your/github/wiki/repo.wiki

You can use Menu / Repository / Open in Terminal to save you having to cd to the repo path before doing your git push. This option also has the Ctrl-BackQuote shortcut on macos.

@brcontainer thanks for the extra details. I was able to reproduce this.

I think there’s two different problems here:

  • detecting it is a GitHub repository and not displaying the “Publish” dialog. We should fix this sooner rather than later because we should be able to identify a GitHub or GitHub Enterprise wiki using your configured accounts.

  • when refreshing the repository, making sure it doesn’t try to fetch issues/PRs/things it doesn’t have. This is already logged in #2061, and because this is silently erroring I think we can defer that. Let’s move discussion about that over to #2061.

Pls cancel this not intersted On Tue, 19 Mar 2024, 3:12 am Jan Brasna, @.> wrote: Back in the day when .wiki repositories were treated as “Other” i.e. not under GitHub.com or user/org headings in @desktop https://github.com/desktop, everything seemed to work back then. Couldn’t the repos for which GH API doesn’t return the needed values be treated as classic git repos in the client? Or maybe shim it by checking the .wiki.git bit and make that fall back to “plain” git operations, disabling all the PR/issue/meta features and just allow a vanilla git access? — Reply to this email directly, view it on GitHub <#3839 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7IKX4ERZ4VXNYR5XC23ZDYY44DNAVCNFSM4EMYPG3KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGQ3TCNZYGI2Q . You are receiving this because you are subscribed to this thread.Message ID: @.>

If you don’t want to follow this thread, unfollow it.

This only seems to be happening with wikis. The repos work just fine. Still happening as of 8/31. On Version 1.3.4 for Windows.

I probably have the same issue: I can’t fetch from any of my GitHub Wiki repositories with GitHub Desktop v1.2.3 for Mac OSX High Sierra, nothing happens when I click on button Fetch origin.

I am using SSH authentication and remote origin URL looks like git@github.com:user/myrepo.wiki.git.

Note that it worked well with previous version of the GitHub Desktop app, and fetching/pulling/pushing works well from git on command line. Otherwise, my GitHub Desktop app works well with my other « regular » GitHub repositories (that is, non-Wiki repositories).

I found to be stable by treating the wiki repo as an external git service, such like gitlab/gitea/etc.

Meaning. Taking the same way to fork the gitlab/gitea repos to GitHub.

Let’s pretend that I have a GitHub repo (KEINOS/wiki-test) which contains a wiki (KEINOS/wiki-test.wiki). And I want to manage the wiki with PR/CI or whatever the gitflow.

Here are the steps I took:

  1. Prepare a GitHub repo with a wiki in it. E.g.) KEINOS/wiki-test

  2. Clone the GitHub wiki to local. E.g.) KEINOS/wiki-test.wiki

    cd /path/to/your/working/dir
    git clone https://github.com/KEINOS/wiki-test.wiki.git
    cd wiki-test.wiki
    
  3. In GitHub, create a brand new GitHub repo. This will be the working repo for the wiki. E.g.) KEINOS/wiki-test-wiki

  4. Set the remote origin URL to the newly created repo (note the target repo).

    $ git remote set-url origin git@github.com:KEINOS/wiki-test-wiki.git
    
  5. Set the remote upstream URL to the original wiki repo (note the target repo).

    $ git remote add upstream git@github.com:KEINOS/wiki-test.wiki.git
    
  6. Check the remote

    $ git remote -v
    origin	git@github.com:KEINOS/wiki-test-wiki.git (fetch)
    origin	git@github.com:KEINOS/wiki-test-wiki.git (push)
    upstream	git@github.com:KEINOS/wiki-test.wiki.git (fetch)
    upstream	git@github.com:KEINOS/wiki-test.wiki.git (push)
    
  7. Launch GitHub Desktop and try edit/commit/push.

    $ github .
    

As soon as the commit is merged, you’ll see that the committed changes reflects both the working repo and the original wiki.

Hope this helps for somebody. 🤞


My env and config info tesed
$ date -R
Wed, 20 Mar 2024 12:17:50 +0900

$ # OS
$ sw_vers
ProductName:	macOS
ProductVersion:	12.7.4
BuildVersion:	21H1123

$ # Git Version
$ git -v
git version 2.44.0

$ # GitHub Desktop
$ # Version 3.3.11 (x64)

$ # Git Configuration
$ git config --list --global
core.excludesfile=~/.gitignore_global
core.quotepath=false
core.ignorecase=false
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
user.name=KEINOS
user.email=github@keinos.com
user.signingkey=0E31BF0923FEC570
url.git@github.com:.pushinsteadof=https://github.com/
gpg.program=/usr/local/MacGPG2/bin/gpg
commit.gpgsign=true
credential.helper=osxkeychain
init.defaultbranch=main

$ git config --list
credential.helper=osxkeychain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.excludesfile=~/.gitignore_global
core.quotepath=false
core.ignorecase=false
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
user.name=KEINOS
user.email=github@keinos.com
user.signingkey=0E31BF0923FEC570
url.git@github.com:.pushinsteadof=https://github.com/
gpg.program=/usr/local/MacGPG2/bin/gpg
commit.gpgsign=true
credential.helper=osxkeychain
init.defaultbranch=main
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=git@github.com:KEINOS/wiki-test-wiki.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
remote.upstream.url=git@github.com:KEINOS/wiki-test.wiki.git
remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
lfs.repositoryformatversion=0

$ # ENV Variables
$ env | grep GIT
GIT_CEILING_DIRECTORIES=/Users
GITHUB_ROOT=/Users/admin/GitHub
GITHUB_TOKEN=ghp_**snip**

Pls cancel this not intersted

On Tue, 19 Mar 2024, 3:12 am Jan Brasna, @.***> wrote:

Back in the day when .wiki repositories were treated as “Other” i.e. not under GitHub.com or user/org headings in @desktop https://github.com/desktop, everything seemed to work back then.

Couldn’t the repos for which GH API doesn’t return the needed values be treated as classic git repos in the client? Or maybe shim it by checking the .wiki.git bit and make that fall back to “plain” git operations, disabling all the PR/issue/meta features and just allow a vanilla git access?

— Reply to this email directly, view it on GitHub https://github.com/desktop/desktop/issues/3839#issuecomment-2004717825, or unsubscribe https://github.com/notifications/unsubscribe-auth/BG7IKX4ERZ4VXNYR5XC23ZDYY44DNAVCNFSM4EMYPG3KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGQ3TCNZYGI2Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

+1 Please fix this.

Can anyone solve this?

GitHub Desktop version 3.2.9 (x64) , git version 2.41.0.windows.2 (64-bit), Windows 11 Home 22H2 OS build 22621.2283.

Still reporting an error when attempting to clone a WIKI.

  • Clone by URL: "We couldn’t find that repository. Check that you are logged in, the network is accessible, and the URL or repository alias are spelled correctly.
  • Clone by GitHub.com: “Sorry, I can’t find any repository matching https://github.comm/*/*public.wiki.git

The Address being used in both was copied directly from the GitHub WIKI page using the button “Clone this wiki locally”.

Please fix this.

Or, at the least, provide a way to backup the wiki from Github Desktop or the web interface.

Fails for me when trying to clone an enterprise GitHub wiki too. I was shocked to find that this has been a known issue for 4 years.

If I was able to upload (or drag-and-drop) images to the web UI wiki, I wouldn’t need to clone the wiki in the first place. I’m shocked that adding images to a wiki is so hard. It’s like GitHub doesn’t want us to use their wiki function. I can upload images easily to this comment, but not a wiki editor.

working with github desktop and a wiki repository seems not at all to be supported unfortunately. Could you please double-check the whole scenario? (clone repo, push etc) I can clone from the command line but then the local directory is not recognized by desktop

still there with 1.3.4 . . . . . clicking on the ‘Fetch origin’ wheel still does not trigger anything from the GUI

same as @olange

It looks like we’re trying to get information from the API for the wiki, but GitHub’s API doesn’t support wikis. Maybe we should strip of the .wiki and use the same information as the parent.

@shiftkey clicking in “Clone in Desktop” button in any wiki repository, example:

Clone in Desktop button

  • After clone repository close the Github Desktop
  • Open Github Desktop again
  • Modify any file
  • Push a commit
  • Click in “Push origin”

Edited:

Note in non-wiki reposirorys the console not show errors, but repositories from github-wiki show 404 error (HTTP), see image:

github desktop get 404 error with wiki repositories

fetchRepository: ‘inphinit/inphinit.wiki’ returned a 404 HEAD https://api.github.com/repos/inphinit/inphinit.wiki/git 404 (Not Found)

@brcontainer apologies for the delay in replying

  1. Clone a wiki repository

Can you clarify how this is being cloned? Using the regular clone URL? Or doing it via the command line and adding the folder to the repository?