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
Hi, I am making a tool to mirror my repo from one git hosting platform to github. What I want to do is using git2rs to achieve:
Step 1 and 2 are successful, but I am not able to implement step 3. Can anyone tell me what is the git2rs equivalent to step 3?
I tried the following appoach:
pub fn push_mirror(repo_path: &PathBuf, remote_url: &str) -> Result<(), git2::Error> { let repo = Repository::open(repo_path)?; if repo.find_remote("mirror").is_ok() { repo.remote_delete("mirror")?; } let mut remote = repo.remote_with_fetch("mirror", remote_url, "+refs/*:refs/*")?; let mut config = repo.config()?; config.set_bool("remote.mirror.mirror", true)?; let mut push_opts = PushOptions::new(); remote.push(&[] as &[&str], Some(&mut push_opts))?; Ok(()) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I am making a tool to mirror my repo from one git hosting platform to github. What I want to do is using git2rs to achieve:
Step 1 and 2 are successful, but I am not able to implement step 3. Can anyone tell me what is the git2rs equivalent to step 3?
I tried the following appoach:
The text was updated successfully, but these errors were encountered: