Better Programming

Advice for programmers.

Follow publication

Member-only story

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Dmytro Khmelenko
Dmytro Khmelenko

Written by Dmytro Khmelenko

Software Engineering | Startups | Education| Technical Leadership | Learn how to boost your career from “Unlock the Code”

Responses (5)

Write a response

I've been happily using switch now for quite some time. In git, where everything can be done several ways, for me the challenge is finding the command for a given operation that fits most comfortably fits into my mental cheat sheet, and switch fits that need.

The parameter is -c and the command git switch -c new_branch will do exactly the same.

WHY would they use a different flag for the same action??? Sigh. :-(

Checkout can also be used to get a single file from another branch into yours.

git checkout [otherbranch] -- [filename]

Which is now also rolled into restore:

git restore --source [otherbranch] -- [filename]

which is again confusing because you…