Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Use `git stash` to Save Local Changes While Pulling


    If we make a change to the same function both locally and remotely, then when we try to pull down the remote changes, we'll run into a conflict - and git won't pull the remote changes down.

    So first, we'll use git stash to stash the local changes, and then git pull to get the remote changes. To apply the stashed changed, we'll then use git stash pop

    Since we changed the same function however, we'll get a merge conflict! So we'll fix the merge conflict, and then add and commit that change.

    Finally, we'll drop the change from the stash with: git stash drop stash@{0}