René's URL Explorer Experiment


Title: Problems with push · Issue #973 · nodegit/nodegit · GitHub

Open Graph Title: Problems with push · Issue #973 · nodegit/nodegit

X Title: Problems with push · Issue #973 · nodegit/nodegit

Description: Hello, I am trying to implement the code snippet found in examples/push.js I have inserted the code pretty much verbatim - only changing the source location for nodegit, the value of repodir and the url specified for the remote to coinci...

Open Graph Description: Hello, I am trying to implement the code snippet found in examples/push.js I have inserted the code pretty much verbatim - only changing the source location for nodegit, the value of repodir and th...

X Description: Hello, I am trying to implement the code snippet found in examples/push.js I have inserted the code pretty much verbatim - only changing the source location for nodegit, the value of repodir and th...

Mail addresses
foo@bar.com
git@github.com

Opengraph URL: https://github.com/nodegit/nodegit/issues/973

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problems with push","articleBody":"Hello,\nI am trying to implement the code snippet found in examples/push.js\nI have inserted the code pretty much verbatim - only changing the source location for nodegit, the value of repodir and the url specified for the remote to coincide with my own github repository.\nRunning the app, the repository is created and newfile.txt is commited however I then get the following error:\n\nTypeError: nodegit.Remote.create(...).then is not a function... \n\nI tried using the resolution code found in Issue 463 but the scenario is somewhat different. Checking the API documentation I see that the create method on Remote is synchronous rather than asynchronous and I'm wondering if that is the issue. I have also successfully employed the example code for cloning a GitHub repository but when I try to commit and push using the code in examples/push.js it fails with the same error.\nThanks so much for your help!\n\nThis is my code:\n\nvar nodegit = require(\"nodegit\");\nvar path = require(\"path\");\nvar promisify = require(\"promisify-node\");\nvar fse = promisify(require(\"fs-extra\"));\nfse.ensureDir = promisify(fse.ensureDir);\n\nvar fileName = \"newFile.txt\";\nvar fileContent = \"hello world\";\n\nvar repoDir = \"newRepo\";\n\nvar repository;\nvar remote;\n\nvar signature = nodegit.Signature.create(\"Foo bar\",\n  \"foo@bar.com\", 123456789, 60);\n\n// Create a new repository in a clean directory, and add our first file\nfse.remove(path.resolve(__dirname, repoDir))\n.then(function() {\n  return fse.ensureDir(path.resolve(__dirname, repoDir));\n})\n.then(function() {\n  return nodegit.Repository.init(path.resolve(__dirname, repoDir), 0);\n})\n.then(function(repo) {\n  repository = repo;\n  return fse.writeFile(path.join(repository.workdir(), fileName), fileContent);\n})\n\n// Load up the repository index and make our initial commit to HEAD\n.then(function() {\n  return repository.openIndex();\n})\n.then(function(index) {\n  index.read(1);\n  index.addByPath(fileName);\n  index.write();\n\n  return index.writeTree();\n})\n.then(function(oid) {\n  return repository.createCommit(\"HEAD\", signature, signature,\n    \"initial commit\", oid, []);\n})\n\n// Add a new remote\n.then(function() {\n  return nodegit.Remote.create(repository, \"origin\",\n    \"git@github.com:johnvogen/push-example.git\")\n  .then(function(remoteResult) {\n    remote = remoteResult;\n\n```\n// Create the push object for this remote\nreturn remote.push(\n  [\"refs/heads/master:refs/heads/master\"],\n  {\n    callbacks: {\n      credentials: function(url, userName) {\n        return nodegit.Cred.sshKeyFromAgent(userName);\n      }\n    }\n  }\n);\n```\n\n  });\n}).done(function() {\n  console.log(\"Done!\");\n});\n","author":{"url":"https://github.com/johnvogen","@type":"Person","name":"johnvogen"},"datePublished":"2016-03-28T16:32:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/973/nodegit/issues/973"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0738f62c-ff3b-65f0-0322-63db54ae3f40
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9B98:19D7AD:29FBA1A:3B107C4:6A5F7268
html-safe-noncecfa5fe819447e576cd914951c10b86721a9134cc7c4ab3e59dced5ecb7a97a95
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qjk4OjE5RDdBRDoyOUZCQTFBOjNCMTA3QzQ6NkE1RjcyNjgiLCJ2aXNpdG9yX2lkIjoiNjc2NDcwOTUzMDY2MDY2NTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac6f0dba92666d2724976d2c80a208a1e703f243d56cb1a0971eef105f10609f1c
hovercard-subject-tagissue:144019898
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/973/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c797d2238fa61e70b520e52b40a39a457ec68b25d3c1d03e20061f3f7c4a63a9/nodegit/nodegit/issues/973
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c797d2238fa61e70b520e52b40a39a457ec68b25d3c1d03e20061f3f7c4a63a9/nodegit/nodegit/issues/973
og:image:altHello, I am trying to implement the code snippet found in examples/push.js I have inserted the code pretty much verbatim - only changing the source location for nodegit, the value of repodir and th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejohnvogen
hostnamegithub.com
expected-hostnamegithub.com
None452de97a03b38f04f76083e607149d32906d2c0b7b8eefeb40f6abb19033123d
turbo-cache-controlno-preview
go-importgithub.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git
octolytics-dimension-user_id657068
octolytics-dimension-user_loginnodegit
octolytics-dimension-repository_id1383170
octolytics-dimension-repository_nwonodegit/nodegit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1383170
octolytics-dimension-repository_network_root_nwonodegit/nodegit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release04b6e0d7b342a002446f33418e84ead364c16c2a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodegit/nodegit/issues/973#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodegit%2Fnodegit%2Fissues%2F973
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodegit%2Fnodegit%2Fissues%2F973
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodegit%2Fnodegit
Reloadhttps://github.com/nodegit/nodegit/issues/973
Reloadhttps://github.com/nodegit/nodegit/issues/973
Reloadhttps://github.com/nodegit/nodegit/issues/973
Please reload this pagehttps://github.com/nodegit/nodegit/issues/973
nodegit https://github.com/nodegit
nodegithttps://github.com/nodegit/nodegit
Notifications https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Fork 698 https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Star 5.8k https://github.com/login?return_to=%2Fnodegit%2Fnodegit
Code https://github.com/nodegit/nodegit
Issues 343 https://github.com/nodegit/nodegit/issues
Pull requests 20 https://github.com/nodegit/nodegit/pulls
Actions https://github.com/nodegit/nodegit/actions
Projects https://github.com/nodegit/nodegit/projects
Security and quality 0 https://github.com/nodegit/nodegit/security
Insights https://github.com/nodegit/nodegit/pulse
Code https://github.com/nodegit/nodegit
Issues https://github.com/nodegit/nodegit/issues
Pull requests https://github.com/nodegit/nodegit/pulls
Actions https://github.com/nodegit/nodegit/actions
Projects https://github.com/nodegit/nodegit/projects
Security and quality https://github.com/nodegit/nodegit/security
Insights https://github.com/nodegit/nodegit/pulse
Problems with pushhttps://github.com/nodegit/nodegit/issues/973#top
https://github.com/johnvogen
johnvogenhttps://github.com/johnvogen
on Mar 28, 2016https://github.com/nodegit/nodegit/issues/973#issue-144019898
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.