Commit a file to a Different Branch Without Checkout

前端 未结 10 2068
南方客
南方客 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

    While there is currently no single command to do this, there are at least two other options.

    1. You could use the github api to create the commit. This post details creating a commit in a github repo.

    2. Create github pages as a submodule.

    3. Use a series of plumbing commands to create the commit.
      The git book has a description of plumbing commands used to create a commit

    note: the command is now mktree not mk-tree

提交回复
热议问题