We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error while pushing a new branch using library
unpacking the sent packfile failed on the remote; class=Net (12)
but if I go to directory and try to push the branch using Git with command, it works without any issues.
git push <remote> refs/remotes/<remote>/<branch>:refs/heads/<branch>
So I am not able to figure out if I am doing anything wrong in script that I wrote or if there is some issue on server.
Here is sample script
let ssh_key = std::path::PathBuf::from(<SSH private key path>) let repo = git2::Repository::open(".")?; let mut remote = repo.find_remote(<remote_name>)?; let mut push_options = git2::PushOptions::new(); let mut cbs = git2::RemoteCallbacks::new(); cbs.credentials(|_url, username, _allowed_type| { git2::Cred::ssh_key(username.unwrap(), None, &ssh_key, None) }); push_options.remote_callbacks(cbs); remote.push( &[&format!( "refs/remotes/upstream/<branch>:refs/heads/<branch>", )], Some(&mut push_options), )?;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Getting error while pushing a new branch using library
but if I go to directory and try to push the branch using Git with command, it works without any issues.
So I am not able to figure out if I am doing anything wrong in script that I wrote or if there is some issue on server.
Here is sample script
The text was updated successfully, but these errors were encountered: