How to mark a file as deleted in a tree using the GitHub API?

Using the GitHub API, I can create a tree containing all the modified files to commit, specify base_treewhich will be updated with this change tree, and then commit it.

But, as the documentation says , a new tree can only contain paths for files with modes

100644for a file (blob), 100755for an executable file (blob), 040000for a subdirectory (tree), 160000for a submodule (commit), or 120000for a blob that sets the path of a symbolic link.

He does not say what to do if I want to mark some path as remote, as with git rm <path>.

+4
source share
2 answers

Currently, the only way to remove an entry from a tree (or blob or another tree) is to build a new tree , rather than listing that entry. Once you have this tree, create a new commit that references this new tree, and don't forget bump ref to point to this new commit.

+4
source

: , , , API , , , ( ).

0

Source: https://habr.com/ru/post/1540416/


All Articles