Search code examples
gitsmartgitorphan

How to add a orphan branch in smartgit


I need to create an orphan branch, which has no parent. How do I do it in Smartgit?

Need some guidance on this..


Solution

  • That is one instance where, if SmartGit doesn't support the orphan option from the GUI, you could as well use the CLI (command-line interface) and type a quick:

    git checkout --orphan newbranch
    

    (as in "In git, is there a simple way of introducing an unrelated branch to a repository?")

    Commit at least one file (still through the GUI):

    git add afile
    git commit -m "a first commit in orphan branch"
    # no push here, this is purely a local operation in your local repo
    

    Then you go back in SmartGit and your new (orphan) branch should be there.