"Stage selected lines" disabled for new files, but no "intent-to-add" available by default?

Hi

I would like to stage only parts of a new file. "Stage selected lines" is disabled in right-click menu, but for a new file Stage Hunk == Stage File and it isn't what I want.

There's no "intent-to-add" command by default. Is "Custom Actions" the way to go here or what is the SourceTree-based process supposed to look like for this?

1 answer

You basically have to add the entire new file to the index first, then select the lines you *don't* want to be in the first commit of this file and click Unstage Selected Lines.

Thanks, I'll try this at next opportunity

This doesn't seem to work, at least as of SourceTree 2.0.5.2. I can add an untracked file to the index, but even when I select specific lines from it, SourceTree only shows the button to allow me to un-stage the entire file.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

155 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you