DEV Community

Discussion on: Handy Git Commands and practices to improve your workflow

Collapse
 
singhrahul31 profile image
singhrahul31

Just a query here. So we take out a branch from the 'main' as 'code fix'. Once done with the changes we would commit & push the branch to the repo. Checkout the 'main' branch and then merge the 'code fix' to the main
Am i saying this right or missing out on something?

Collapse
 
tngeene profile image
Ted Ngeene

Yeah, you're saying it right. But the appropriate way is to push it to the repo and wait for it to be merged. The only reason you'd merge locally is when you're working alone. But it's advisable that you push to the remote, once it's been merged then you can pull from the master.