question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello 👋, I’m using Isomorphic Git on a NodeJS environment, and I’m having an issue pushing a repo using the following code:

(async function push() {
	const rPath = process.argv[2]
	const email = process.argv[3]
	const passwd = process.argv[4]
	console.log(rPath, email, passwd)
	try {
		const pushResponse = await git.push({
			dir: rPath,
			remote: 'origin',
			ref: 'master',
			username: email,
			password: passwd
		})
		console.log(`Pushed repo at ${rPath} to origin.\nAnswer: ${pushResponse}`)
	} catch(e) {
		console.log(e)
	}
})()

index.js:1300 TypeError: Cannot read property ‘split’ of null

Acccording to jcubic in #690, the issue comes from username and password

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gperl27commented, May 10, 2019

Realized you need to use the proper dir that you create programmatically and not the just / (like the docs example).

As in the dir at const dir = fs.mkdtempSync(path.join(os.tmpdir(), "myTmpDir")) vs / if you’re following the starter tutorial.

0reactions
gperl27commented, May 10, 2019

Getting the same error when trying to push as well. I get through the node starter flow fine - writing a new file and ability to commit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git error: failed to push some refs to remote - Stack Overflow
(Note: starting Oct. 2020, any new repository is created with the default branch main , not master . And you can rename existing...
Read more >
Error: failed to push some refs to – How to Fix in Git
When collaborating with other developers using Git, you might encounter the error: failed to push some refs to [remote repo] error.
Read more >
How to Fix 'failed to push some refs to' Git Errors - Komodor
failed to push some refs to errors are often caused when changes are not committed before pushing, issues with Git pre-push hook, incorrect...
Read more >
Git Push Errors - Cribl Docs
Your first push to a remote repo might fail with one of several failed to push some refs errors. As a first step...
Read more >
Git Error | GitHub Error: failed to push some refs to '[REPO URL]'
Are you starting to use Git / GitHub and just came across the message " failed to push some refs to ..."?Don't worry,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found