I am in an environment where I am supposed to only push working and consolidated commits that solve an issue. For example: "This commit fixes bug XY", "This commit adds feature YZ". (to avoid cluttering up the commit history)
What workflow should I adopt if I want to keep my local changes (debug statements, work in progress), but often (several times per day) I am asked to git pull to apply changes from the team?
I guess the idea of git is that you commit often, but an ideal situation for me would be if I could track my work in progress privately and only publish "consolidated" commits to the remote repository. And at the same time constantly be able to merge-in what my team members have done already.
"Subversion way"
I have a long history with subversion (So the main issue here might be I am thinking about this wrong), where any remote changes would be automatically merged with my local, uncommitted changes. Conflicts would be solved on checkout.
So far, in git I have been doing:
git stash
git pull
git stash pop
"The git way" (Commit often, merge often I guess?)
How people approach this in git in general?
I was thinking about keeping private "feature" branches and then do local squashed merges of the feature branches to master once something is finished and ready to be published, so that what gets sent into the remote repository is a single commit saying "this fixes issue XY?"
I have not tried this so far, but it looks as if I would have to do a lot of merges all the time so it does not feel right.