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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Push only some commits

Is there a way to push only some of your commits using SourceTree?


Thanks

2 answers

1 accepted

2 votes
Answer accepted

You can use Custom actions, on my Mac I've done:

  1. Preferences custom actions => Add
    Menu Caption: Push to master till this commit
    Script to run: git-push-till-commit
    Parameters: $SHA
  2. In a directory, which will be searched by PATH I've created a shell script "git-push-till-commit"
    vi git-push-till-commit

    #!/bin/bash
    SHA_COMMIT_HASH=$1
    echo "Calling git push origin $SHA_COMMIT_HASH:master"
    git push origin $SHA_COMMIT_HASH:master

    chmod a+x git-push-till-commit

  3. Now if I wish to push some subset of commits, I select the last one => Right mouse click => Custom actions => Push to master till this commit

Hi Gabriel,

We support this functionality in Mercurial (just right click on a log row and hit 'Push'). This will just pre-fill the revision field in the push sheet, so you can do this manually from the push sheet, too. We don't currently support this in Git despite it being technically possible using the syntax

git push <remote> <commit SHA>:<remote_branch>

You can file feature requests at jira.atlassian.com if you'd like to see this in SourceTree.

Cheers

Thank you, Kieran. I have submitted two feature requests:

Just remember it pushes all commits 'up to' the commit you specify. Thanks for the feature requests!

Suggest an answer

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

Step up your DevOps game webinar Q&A series - Questions answered!

  On October 21st, 2020 we hosted a webinar titled,   Step Up You DevOps Game with 4 Key Integrations for Jira and Bitbucket. We had a great showing and high engagement, but that meant th...

117 views 0 1
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