Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by karatinversion

6 months ago

You are looking for

  git update-ref <branch-name> <commit-sha>

2 comments

karatinversion

Reply

DiggyJohnson  6 months ago

Wouldn't the fail or break under any circumstance where they don't immediately share a history?

  • karatinversion  5 months ago

    I just tested it by creating a repo with two branches without a common ancestor, and I was able to move a branch pointer to either history with update-ref, so no, I don't think so

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities