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
I was trying to unstage files. I can add file fine by using
let mut index = repo.index().unwrap(); index.add_path(Path::new(&path)).unwrap();
I saw we can use the remove_path like this
let mut index = repo.index().unwrap(); index.remove_path(Path::new(&path)).unwrap(); index.write().unwrap();
but this deletes file not remove changes
what can I do? and I saw this remove but the 2th parameter stage is an int but have no more detail https://docs.rs/git2/latest/git2/struct.Index.html#method.remove
The text was updated successfully, but these errors were encountered:
The 2nd parameter is usually 0 for the main index. Other numbers are used when dealing with merge conflicts and such.
Sorry, something went wrong.
@ehuss ok I understand that now.
so what can I do to just unstage changes from a file, any ideas?
It's index.remove(path, 0)
index.remove(path, 0)
No branches or pull requests
I was trying to unstage files. I can add file fine by using
I saw we can use the remove_path like this
but this deletes file not remove changes
what can I do?
and I saw this remove but the 2th parameter stage is an int but have no more detail
https://docs.rs/git2/latest/git2/struct.Index.html#method.remove
The text was updated successfully, but these errors were encountered: