DEV Community

Discussion on: Delete Your Master

Collapse
 
denolfe profile image
Elliot DeNolf

This seems like a really odd flow. In my mind, you're trying to prevent commits directly on master which is good practice. However, this can easily be achieved by setting the permissions on the repository so that master can only received code via pull/merge requests.

Collapse
 
jessekphillips profile image
Jesse Phillips

I'm actually trying to eliminate the maintenance of a local master. It also emphasizes keeping up to date with remote when work starts.

I'm trying to avoid poorly named branches, ones that aren't named for the work being done.

If you're already comfortable with remotes and branch management then this advice isn't necessary, but I'd be curious what you do on local master?

Collapse
 
shhac profile image
Paul Somers

what you do on local master?

I've probably run all of the following on/using master in the last 2 weeks (albeit some via aliases)

git pull --ff-only
git branch --merged
git branch -r --merged
git rebase master
git merge master
git checkout -b
git reset --hard HEAD
git checkout master -- ./foo
git diff master...HEAD -- ./foo

Yep most of these would be equal with origin/master, but that is more typing, and others might result in a longer message (merge commit)

Thread Thread
 
jessekphillips profile image
Jesse Phillips • Edited

Not checking my commands but what is wrong with

git fetch & git switch --detach origin/master
git branch --merged
git branch -r --merged
git rebase origin/master 
git merge origin/master
git switch -c 
git reset --hard HEAD
git checkout origin/master -- ./foo
git diff origin/master...HEAD -- ./foo
Enter fullscreen mode Exit fullscreen mode