DEV Community

Discussion on: How do you use git when working solo?

Collapse
 
areskul profile image
Areskul • Edited

I always make a main, and a dev branch.
I fork the dev branch in many feature/* branches that I merge to the dev.

git branch feature/vite
git merge feature/vite
Enter fullscreen mode Exit fullscreen mode

Heavy usage of "gitu" alias to push to remotes and mirrors.

alias gitu="git commit -a | git push"
Enter fullscreen mode Exit fullscreen mode

and when I need add modification to previous commit.

git commit --amend
Enter fullscreen mode Exit fullscreen mode

And I try to write good commit messages following Angular conventions.

When I'm satisfied with my work I tag it (for further fast version reverse).

git tag 0.4.5
Enter fullscreen mode Exit fullscreen mode

In case I need to revert bad changes that went into main branch(production)

git checkout 0.4.4
Enter fullscreen mode Exit fullscreen mode

What about you?!

Collapse
 
tbroyer profile image
Thomas Broyer

I really don't get that main vs dev in git-flow.

Collapse
 
sanampakuwal profile image
Sanam

Ongoing development features branches will be merged to dev regularly and dev will be merged to main when dev becomes stable and mergable.

Thread Thread
 
tbroyer profile image
Thomas Broyer

That doesn't explain (and even less so justify) why you do it.

Also, does that mean that dev is not always in a releasable state?

Thread Thread
 
areskul profile image
Areskul

Yes, dev is unstable !

Thread Thread
 
tbroyer profile image
Thomas Broyer

You're saying this as if it's a feature. In projects I work on, they could be released/deployed almost at any time (at a minimum they are deployable to a testing/demo server), and if the tip of the branch happens to not be, we can easily deploy/release a version from a few commits earlier. Tag it and call it a day. I don't get that "merge dev to master" process.

Are you really saying your dev branch can at times be in a state where you'd say about it: "oh yes, this is currently entirely broken, but don't worry, we'll fix it in time for the scheduled release"?

Thread Thread
 
sanampakuwal profile image
Sanam

Dev is not totally unstable! It's yet not ready for production. All internal phases (dev, test, regression) will be carried out here and finally will be merged into stable branch (name as per your preference)