git branching - how to make current master a branch and then revert master back to previous version?

前端 未结 2 1582
青春惊慌失措
青春惊慌失措 2021-02-10 15:58

This is probably quite simple but I\'m currently a git noob and haven\'t quite got my head round the git branching model yet.

Suppose I currently have no branches other

2条回答
  •  执念已碎
    2021-02-10 16:54

    Suppose I currently have no branches as such

    Just to correct you: You always have at least one branch in Git. Even master is a branch, with the same features as any other branches. And Git doesn't handle a branch named master different than another branch. It is just a convention, that most developers name their main branch "master", but you don't need to. You could even delete your master branch and create branches like development, release etc. For your question itself: The answer of Kit Ho is good.

提交回复
热议问题