Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backup a Git stash to GitHub

I want to stash work in progress, but I also want what I've stashed to be backed up on GitHub. Previously I've normally committed with a comment saying "WIP: blah blah blah", but I'd rather commit in completed stages rather than loads of "WIP:" commits which are really just a way to backup my work to the GitHub servers.

Is there a way to have stash to GitHub?

like image 652
Jimbo Avatar asked Dec 26 '22 22:12

Jimbo


1 Answers

You can't put the stash on GitHub, but you can (and should) create a branch and commit to that:

git checkout -b temporary
git add -A
git commit -m "storing work in progress"
git push

Then just merge temporary into master (or whatever) when it's ready.

Edit: removed superfluous stash commands.

like image 87
Jim Stewart Avatar answered Jan 09 '23 04:01

Jim Stewart