It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I cherry pick the files I want to shelve

I have 5 modified files. Two are modified to facilitate getting my local dev server going instead of for staging or production servers. Those I frequently need to shelve and unshelve as part of doing a Pull/Update. The other three are actual changes I may commit someday. 

How can I shelve the two files to one shelf and the other 3 files to another shelf and access either later using a name I choose?

Is this possible? If so, how?

1 answer

0 votes
Manju Atlassian Team Jan 19, 2018

You should make use of Patch for the 2 files that you'll use often and doesn't need to be checked in. 

Once you have a patch, you can apply it as many number of time as possible in any branch. 

Shelves may not work the way you want on other branches.

This sounded like a good idea but when I created a patch file of the two files involved, discarded the changes to both files, then applied the patch file, both file contents were completely replaced instead of just the diff changes shown in the patch. Is this normal for patch files to replace the contents with modified content such that the top half the diff view shows pink "-" lines and the bottom half shows green "+" lines? When I complete a shelve operation in TortoiseHg it simply shows only the modified lines in pink/green, not the whole file content. One of my two files has 2 lines changed, the begin comment and end comment symbols (commenting a 10 line block of code.) Yet the patch shows it needed to replace all contents. 

Manju Atlassian Team Jan 22, 2018

Patches are ideally nothing but diffs. Have you tried ignore whitespace for the diff that you are seeing? 

Yes, that changed the diff view to show only the lines that changed! Thanks!

Why is there a difference? When I view the same diff but using an external Beyond Compare (which will show any whitespace diffs) it only sees the few lines that changed, not the whole file. It seems the default setting of Show whitespace option is not really showing correctly?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,917 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you