MeltingDog
MeltingDog

Reputation: 15404

How do I 'Git stash' in Github Desktop?

Due to some weird issues involving SSH (also I am new to git) I could not contribute to a git project via the command line, so had to use the GUI Github Desktop.

Everything was going fine until my co-worker made some changes overnight. I cannot pull them down to my local due to conflicts with my local files (there's about 30 files updated).

How, in Github Desktop, can I simply override all my local files with his changes?

Upvotes: 1

Views: 4382

Answers (3)

VonC
VonC

Reputation: 1323553

You would need GitHub Desktop V2.0.0, which now (June 2019) does supports stashing.

See desktop/desktop issue 6107, and its design

I imagine this is someone working on a feature branch who wants to move to master, and wants their changes to stay on the feature branch.

  • Users will only (at least at first) create stashes when switching branches.
  • We'll prompt them with a modal asking what they want to do with their uncommitted changes.
  • If they want their changes to stay, we'll create a stash for them.
  • When they return to that branch, they'll be able to click into and see their stash, clear and apply/pop it.
  • This also encourages the current default behavior of taking uncommitted changes with you to a new branch

https://user-images.githubusercontent.com/32687858/59403208-a6ffda00-8d56-11e9-958a-f060f8cad7d2.png

Upvotes: 0

Paritosh Singh
Paritosh Singh

Reputation: 6384

Follow below steps: 1. Create a new branch from current branch.
2. Checkout to new branch and delete older branch.
3. Pull branch present on remote.
4. Cherry pick all the valid commits from new branch.

Thanks

Upvotes: 1

bjupreti
bjupreti

Reputation: 353

All you have to do is delete your branch and refetch the branch you want. This way all his changes comes into your branch. But, if you also have some changes that you don't want to delete then you can make a new branch and merge that branch in your branch.

Upvotes: 1

Related Questions