How do I commit changes locally that I don't want pushed to the repo?

Fred Wood August 18, 2014

I have made changes to files in my working copy that are specific to just this project, and now I want to commit these changes, but in this project only. If I commit these changes, the commit shows up in push. How do I prevent them being pushed back to the repo?

1 answer

1 accepted

0 votes
Answer accepted
Mirko Skramusky
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014

Hi Fred!

you can commit your changes without pushing it to anywhere else. You git-client should not do this automatically. I don't know what you mean by "specific to just this project", maybe it's a good idea to create a branch and commit you changes only to this branch without merging to you main branch ("master").

Hope this helps.

Fred Wood August 18, 2014

Hi Mirko,

Thanks for responding. My repo contains general files that are common to all projects, however, each project will customize some of those files and those changes should never go back to the repo. I think my confusion came from not realizing that working copy changes could be applied to any branch. What I mean is, I thought that if I had Master checked-out when I made changes, those changes would only be available for committing in the branch they were created in. Now I see that I can pick and choose which changes are committed in which branch.

I have done as you suggested and created a branch to commit the changes only in my local project. Thanks for the reply

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events