Git tips

Need something from another branch, but you only need changes in 1 file?

A couple of examples:

# replaces whole file in your working branch, but leaves your other work untouched
git checkout source-branch -- path/to/file

# We might need all the styling from another branch
git checkout source-branch -- *.scss *.css

All articles


Comments

No published comments yet.


Add a Comment

Your comment is held for review before it appears publicly.

Your email is never published or shared.

Up to 2,000 characters.

Tick the box, then click Submit right away (Google expires the check after about two minutes).