Search code examples
gitgithubgit-stash

"Git stash" push temporary fix to my repo


I working with a fork and I made a temporary fix but I don't want to make a commit yet since the changes aren't finished.

I'm going to use "git stash" to save those changes temporarily and then continue working in another branch. What I'd like to know is if there is a way to save those changes in my repo on github like a backup and then getting them back to continue working on them without any commit until finishing them. Otherwise those changes are only in my computer with the risk to lose them. Thanks


Solution

  • I will prefer to create branch for your temporary fix and push it to github. Checkout new branch and work on that. Steps:

    1. Create a temporary branch
    2. Commit your fix and push to github
    3. Work on any other branch you wish
    4. Later Merge temp branch to your new / any other branch

    No changes will be pushed to github unless you commit them.