Praveen
Praveen

Reputation: 13

Stash-git pull issue

We are using Stash for our SCM. Currently we are a team of three (developer1,developer2,developer3). Developer1 is working on branch1 of a stash repository. He has pushed some changes on branch1 which I am also working.I want to pull the branch1 data from remote server to my working copy.

But pull get aborted because I have my local changes via 'source tree tool'. How can I keep my local changes and pull the data from remote server without overwriting it? I want to push the local changes to remote afterwards as latest commit.

Please help.

Upvotes: 1

Views: 109

Answers (2)

David Deutsch
David Deutsch

Reputation: 19015

If your current changes are complete enough for a commit, then go ahead and commit them before you pull. Then when you pull git will merge your changes with the other developer and create a new commit with those merged changes. Then go ahead and push.

Upvotes: 1

Zeeshan Hyder
Zeeshan Hyder

Reputation: 518

Use git stash to stash your local changes. This will set your branch pointing to last commit from remote. Then do git pull to get latest changes. This will pull his changes to your local. Now if you want to write changes that you made (you just stashed them), use git stash apply to apply your changes on top of latest changes.

Upvotes: 1

Related Questions