Warm tip: This article is reproduced from stackoverflow.com, please click
git github

creating a branch from Git commit ID within Github web UI

发布于 2020-04-04 10:10:07

This deals : How do I create a new Git branch from an old commit? about creating new branch needed from command line on a repository based on commit-id

pretty much,

git checkout -b ini_commit_ref_branch cf05eed4fbd76e30615e3876ead9ddb7c5593cd8 # eg commit
git push --set-upstream origin ini_commit_ref_branch

But how to achieve same within Github WebUi - as option of creating remote branches we get only on existing branches not from commit hash. Do we have that feature within web-ui ?.

All we see are below icons when we traverse to history of commits against selected branch in repo..

enter image description here

Questioner
vinWin
Viewed
53
Lasse V. Karlsen 2020-01-31 21:43

Here's how you do it.

First navigate to the commit in question, and then click on the <> button next to the commit in your history. This will show the web interface for browsing that particular commits snapshot of the repository.

Then, you see a small button with the commit id, just above the contents, like this:

enter image description here

Then, click the down arrow on this button to show the dropdown. It looks like this one allows you to browse different branches in the repository but you can actually create a new one. Simply type in the name of the new branch in the search field:

enter image description here

Then click on the "Create branch: ..." link at the bottom of this dropdown, and a new branch should be created.