admin管理员组文章数量:1310802
I am using vscode in windows for writing on local ddev instance, and trying to push the code to github, however encountering problems.
To check the process, I created a new folder on windows, and tried to commit from there instead.
My terminal commands in windows seem to run on powershell, and look like this
PS C:\Users\Dave\Documents\TMP\GitTest> git remote
PS C:\Users\Dave\Documents\TMP\GitTest> git remote add origin .git
The output screen shows the following
2025-02-01 19:09:08.701 [info] > git config --get commit.template [72ms]
2025-02-01 19:09:08.701 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/main refs/remotes/main [69ms]
2025-02-01 19:09:08.776 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [68ms]
2025-02-01 19:09:08.776 [info] > git status -z -uall [72ms]
2025-02-01 19:09:08.841 [info] > git config --local branch.main.github-pr-owner-number [59ms]
2025-02-01 19:09:08.841 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:09:08.901 [info] > git config --local branch.main.remote [57ms]
2025-02-01 19:09:08.901 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:09:08.961 [info] > git config --local branch.main.merge [56ms]
2025-02-01 19:09:08.961 [warning] [Git][config] git config failed: Failed to execute git
I don't know why I get the failure messages, as then trying to push results in this
PS C:\Users\Dave\Documents\TMP\GitTest> git push -u origin main
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 215 bytes | 215.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To .git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
PS C:\Users\Dave\Documents\TMP\GitTest>
With the following output
2025-02-01 19:09:49.150 [info] > git config --get commit.template [60ms]
2025-02-01 19:09:49.153 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) --ignore-case refs/heads/main refs/remotes/main [61ms]
2025-02-01 19:09:49.227 [info] > git status -z -uall [71ms]
2025-02-01 19:09:49.228 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [69ms]
2025-02-01 19:09:49.294 [info] > git merge-base refs/heads/main refs/remotes/origin/main [62ms]
2025-02-01 19:09:49.316 [info] > git config --local branch.main.github-pr-owner-number [60ms]
2025-02-01 19:09:49.316 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:09:49.358 [info] > git diff --name-status -z --diff-filter=ADMR 1f690417e228a1652c5f75a979b727147dc3b6f9...refs/remotes/origin/main [61ms]
And the files are on github.
I then delete the repo on github and repeat exactly with my existing ddev project.
The terminal is a bash shell rather than powershell, and this is what happens.
Terminal
dave@Dave-Main-2020:~/ddev-drupal-test2/web$ git remote
dave@Dave-Main-2020:~/ddev-drupal-test2/web$ git remote add origin .git
dave@Dave-Main-2020:~/ddev-drupal-test2/web$
Output
2025-02-01 19:11:54.820 [info] > git config --get commit.template [3ms]
2025-02-01 19:11:54.822 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [3ms]
2025-02-01 19:11:54.828 [info] > git for-each-ref --sort -committerdate --format %(refname) %(objectname) %(*objectname) [2ms]
2025-02-01 19:11:54.829 [info] > git status -z -uall [5ms]
2025-02-01 19:11:54.921 [info] > git ls-files --stage -- /home/dave/ddev-drupal-test2/web/.gitignore [2ms]
2025-02-01 19:11:54.924 [info] > git cat-file -s 0724656193b7cc76790a86b9dd76bf3213b908c6 [1ms]
2025-02-01 19:11:54.931 [info] > git show --textconv :.gitignore [3ms]
Terminal
dave@Dave-Main-2020:~/ddev-drupal-test2/web$ git push -u origin main
fatal: unable to access '.git/': Failed to connect to github port 443 after 132361 ms: Couldn't connect to server
dave@Dave-Main-2020:~/ddev-drupal-test2/web$
Output
2025-02-01 19:12:47.972 [info] > git config --local branch.main.github-pr-owner-number [4ms]
2025-02-01 19:12:47.972 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:12:48.016 [info] > git config --local branch.main.remote [41ms]
2025-02-01 19:12:48.016 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:12:48.019 [info] > git config --local branch.main.merge [1ms]
2025-02-01 19:12:48.019 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.090 [info] > git config --local branch.main.github-pr-owner-number [1ms]
2025-02-01 19:15:01.090 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.093 [info] > git config --local branch.main.remote [0ms]
2025-02-01 19:15:01.094 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.096 [info] > git config --local branch.main.merge [1ms]
2025-02-01 19:15:01.096 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.116 [info] > git config --local branch.main.github-pr-owner-number [2ms]
2025-02-01 19:15:01.116 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.120 [info] > git config --local branch.main.remote [2ms]
2025-02-01 19:15:01.120 [warning] [Git][config] git config failed: Failed to execute git
2025-02-01 19:15:01.124 [info] > git config --local branch.main.merge [2ms]
2025-02-01 19:15:01.124 [warning] [Git][config] git config failed: Failed to execute git
What difference would running this from ddev location, instead of a windows direct location make?
UPDATE WITH MORE DETAILS
I start with a new folder with just one file in it:
Then I have a brand new github repo
which gives me the commands for connecting
I can then see in VSCode that there is no version control
So I run git init
and then I can see the version control, and following the process given by github, I can commit, add the remote and push
After which, I can see my file in github
BTW: git --version git version 2.47.1.windows.2
Then trying the same thing with the VSCode that I have running for a real project, which is on a DDEV.
(I delete and create the github repo again to start clean)
You can see from the image below, that everything is ok (starting from the arrow) up until the, push. However.. I now see that whilst a ping works, a curl to github doesn't work, so maybe there's some connectivity issue from the ddev env directly - I also don't know how to solve that one!
本文标签: gitVS Code github gitpush issuetest worksreal code doesn39tStack Overflow
版权声明:本文标题:git - VS Code github gitpush issue - test works, real code doesn't - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741867172a2401976.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论