4 ms·
This. Git makes using branches very easy and it is fairly quick with most operations. Once you understand what the commands are doing, you'll see that unless y
by bloodorange 9y ago
This.
Git makes using branches very easy and it is fairly quick with most operations. Once you understand what the commands are doing, you'll see that unless you do something specifically (like reset --hard with uncommitted changes, checkout a modified file etc.), you'll never lose work which has been committed in some branch or the other.
I tend to just do "in-between" commits very often and rebase to reorganise the commits (reorder, squash, reword) when I hit a (micro)milestone.
If your work has been committed and the repo was not just garbage collected, it is going to be easy to retrieve it from reflog even if you did something nasty with the branch and it appears that your commit has disappeared.
Git is the piece of software which I find very good in terms of what it does but it does it behind the worst user-interface I have ever encountered.
EDIT: minor clarifications and punctuation