Git101: When You Can And When You Can Not Switch Branches — When Just Modifying Files

Your local changes to the following files would be overwritten by checkout

1. notes

  • Create a branch1
  • Modify file
  • Checkout branch2
  • Succeeds
  • Checkout branch1
  • Stage/commit initial changes to branch1
  • Modify file again
  • Do not stage/commit yet
  • Checkout branch2
  • Fails
error: Your local changes to the following files would be overwritten by checkout:
<file>
Please commit your changes or stash them before you switch branches.
Aborting

2. links

--

--

--

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Quickly building an highly scalable and customizable real-time chatting platform on AWS

Test-Driven Study

Certificates, certificates!

How to Use Slack to Connect Your Community during COVID-19: A Quick-Start User Guide

Creating AWS CodePipeline Using AWS CDK

Reversal Patterns: Engulfing Pattern

Modern storage is plenty fast. It is the APIs that are bad.

Basic and Useful Python Tricks

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavol Kutaj

Pavol Kutaj

Infrastructure Support Engineer/Technical Writer (Snowplow Analytics) with a passion for Python/writing documentation. More about me: https://pavol.kutaj.com

More from Medium

How to write a make file for C/C++?

Python object-oriented programming — Composition over Inheritance

On The Value Of Tactics With Powershells Multiple Find And Replace Oneliner