Commit a file to a Different Branch Without Checkout

前端 未结 10 2071
南方客
南方客 2020-12-05 09:55

Is it possible to commit a file in a git branch with out checking out that branch? If so how?

Essentially I want to be able to save a file in my github pages branch

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 10:25

    It can be done by reimplementing git commit.

    This can be done with various call to git hash-object

    But this is hard to achieve.

    Please read progit chapter 9 for more details and a full example of how to simulate a commit.

提交回复
热议问题