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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,461,683
Community Members
 
Community Events
176
Community Groups

Can I stash specific uncommitted files or is it a all or nothing deal

I have a lot of files that I have worked on. Is it possible to stash just specific uncommitted files or is it all or nothing? What would be the best way to only commit certain files and leave the others? Would that be just to stage the specific files and commit them?

I am using Windows 10 and version 3.4.7.

Thanks.

1 answer

1 accepted

1 vote
Answer accepted
Mikael Sandberg Community Leader Jan 31, 2022

Hi @Greg Davis,

Welcome to Atlassian Community!

Git stash is an all or nothing command, so you cannot stash just a subset. Git commit allows you to select the files you want to commit, you just have to use git add to specify the files that you want to commit.

Thanks @Mikael Sandberg  Thanks for the reply. The reason I ask is that I have 12 files but I only want to commit and push two of them.

How do I do the git add in Sourcetree?

Can I stash the unstaged files and not affect the staged files?

Mikael Sandberg Community Leader Jan 31, 2022

In Sourcetree you have the option to stage specific files, and when you commit it will only include your staged files. This is the equivalent to using git add from the command line. Have a look at Create a file, add it locally, and push it to Bitbucket for a simplified example.

Then when I commit the staged files, I can then stash the unstaged files?

So when I commit the two files, I would push them?

Mikael Sandberg Community Leader Jan 31, 2022

If you want your commit to be available on the remote repository, then yes, you need to push it. There should be a checkbox that allow you to push automatically when you make your commit.

Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events