Skip to content
New issue

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

Add a file argument to git_reset_*() #220

Open
olivroy opened this issue May 20, 2024 · 0 comments
Open

Add a file argument to git_reset_*() #220

olivroy opened this issue May 20, 2024 · 0 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented May 20, 2024

so it would be wasier to revert changes to a single file if a commit touched multiple files

git_reset_soft("HEAD~3", file, repo)

to allow to go back to state the a previous for file (3 commits before) but to leave all other files alone. So we can add a commit to revert change to that specific file.

Related to #188. it would be great to be able to cherry-pick changes to a file in a branch to another one.

git reset has pathspec https://git-scm.com/docs/git-reset

Cannot do hard reset with paths however.

Potentially git revert unstaged could be.

git_commit() + git_reset_hard() (revert all uncommited) + git_reset_soft()` (restage files, but uncommit them)

@olivroy olivroy changed the title Add a file argument to git_reset_soft() Add a file argument to git_reset_*() Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant