Is there a way to push a WIP branch and keep the changes uncommitted locally?

Viewed 148

Here is my dilemma: I'd like to have all of my changes uncommitted locally because Xcode makes it much easier to see and jump between them, but I also want to commit the changes and push a WIP branch for others to review.

This is the workflow I came up with and I'm sure I could easily script it, but I'm guessing there is a better way:

  1. Commit the changes to a WIP branch
  2. Push the branch
  3. Delete the branch
  4. Recreate the branch
  5. Cherry pick the commit with the --no-commit option
1 Answers

Steps 3 and 4 are not necessary. Change Step 5 to git reset HEAD^ --soft or git reset HEAD^. Both reset the current branch back to the previous commit. The former keeps the changes staged and uncommitted, and the latter keeps the changes not staged.

Related