Repository: vscode
Issue: GitHub - Unable to push to existing fork with codespaces
Labels: bug,github,github-codespaces


Issue Type: <b>Bug</b>

I currently have some established forks I want to be able to push to.

Say this repo https://github.com/gregjones/httpcache which has a fork here https://github.com/tjamet/httpcache.

I created a codespace and, as usual, edit the files, opened the terminal and run the proper git command to forge my commit.

I am since then looking for an integrated way to push the changes to my fork https://github.com/tjamet/httpcache

When I try a plain push, I get the error that I don't have the permissions and am invited to create one. When I create one, it fails with the error that it already exists.

If I then try to push using git push https://github.com/tjamet/httpcache.git/ HEAD:refs/heads/my-branch, I also get a permissions denied.

pushing using git push jamet HEAD:refs/heads/test, I get this error:

```
remote: Permission to tjamet/httpcache.git denied to tjamet.
fatal: unable to access 'https://github.com/tjamet/httpcache.git/': The requested URL returned error: 403
```

I obviously don't want to inject my own SSH key in a remote environment (not even possible as they are in yubikeys and it is hence impossible to extract it).

In short, I have a commit in this codespace https://tjamet-gregjones-httpcache-pjgp7x9qc7rp6.github.dev/ I can't push nor recover those commits locally.

VS Code version: Code 1.68.1 (Universal) (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:52:13.188Z)
OS version: Darwin x64 21.2.0
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-1074-azure

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2200)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|7, 11, 20|
|Memory (System)|32.00GB (0.97GB free)|
|Process Argv|--crash-reporter-id ffb9f4eb-493e-428c-bae5-10e02ee910de|
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|Codespaces|
|OS|Linux x64 5.4.0-1074-azure|
|CPUs|Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (4 x 2593)|
|Memory (System)|7.77GB (1.82GB free)|
|VM|0%|
</details><details><summary>Extensions (16)</summary>

Extension|Author (truncated)|Version
---|---|---
codespaces|Git|1.9.1
jupyter-keymap|ms-|1.0.0
remote-containers|ms-|0.238.2
scala|sca|0.5.5
codespaces|Git|1.9.1
vscode-pull-request-github|Git|0.44.0
go|gol|0.34.0
vscode-sbt-scala|lig|0.2.4
vscode-docker|ms-|1.22.0
python|ms-|2022.8.0
vscode-pylance|ms-|2022.6.20
jupyter|ms-|2022.5.1001601848
jupyter-keymap|ms-|1.0.0
jupyter-renderers|ms-|1.0.8
vsliveshare|ms-|1.0.5625
scala|sca|0.5.5

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdc:30486549
841h4636:30513947

```

</details>

<!-- generated by issue reporter -->