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

Deleting a file using TreeEntry/CreateTree/CreateCommit? #1268

Open
bmcstdio opened this issue Aug 30, 2019 · 1 comment

Comments

@bmcstdio
Copy link

@bmcstdio bmcstdio commented Aug 30, 2019

I know it is possible to delete a file using DeleteFile, but that doesn't seem to support signing the resulting commit. Hence, I'd like to be able to use TreeEntry, CreateTree and CreateCommit to delete a file, but I can't seem to be able to do that. Is there an example of deleting a file using these APIs I can have a look at?

@gmlewis

This comment has been minimized.

Copy link
Collaborator

@gmlewis gmlewis commented Aug 30, 2019

Looking at our source-of-truth, which is the GitHub Developer API v3 (that this repo is simply a client of):
https://developer.github.com/v3/git/trees/#create-a-tree
It appears that you could create a tree and commit it and the new tree will completely replace the contents of the previous tree.

I have not done this myself and don't have time to create an example, but it looks like this is possible.

If other contributors feel like cooking up an example for @bmcstdio, you are welcome to, and I'll leave this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.