Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How would I discard multiple, but not ALL hunks in a single file?

lauracastro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 4, 2020

For example I have file with 67 'hunks' and I only want to keep 3 of them to stage and commit. Do I need to click 'Discard Hunk' 64 times to do this or is there an easier way?

1 answer

0 votes
John Damant
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 26, 2021

This might be too late but i just had the same issue with iOS storyboards, if you click the icon above "discard hunk" (circle with three dots and a down arrow) and choose external diff then when your diff opens select all ctrl-a/cmd-a and using the selection drop down on the bottom right choose ALL from your remote repo, then go back through and choose YOURS on the 3 you want to keep, save and close and the diff is updated. Hopefully this helps someone

John Damant
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 4, 2021

I found an even easier way to do it. Click any line you want to commit (you can click and drag to select multiple lines) then right click and choose "Stage selected lines"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events