I've done quite a lot of search on this problem but didn't find an answer, though it seems to be a common scenario. Sorry if it is still a duplicate.
I use Git to manage my Java source files. I'm the only developer. I created a 'remote' repository on a LAN share. I regularly 'push' my master branch to this remote repository, because the LAN share is safe against data loss (it is backed up). I use TortoiseGit on Windows, I do not use Git command-line.
Usually, I work on 2-3 new features in parallel. I create a new Git branch for each feature (aka feature branches). When I'm done with a feature, I merge it to master by creating a 'merge commit'. This works fine.
After merging I 'push' my master branch to the remote repository so that my changes are safe. My problem is that this does not do exactly what I want. My 'merge commit' is pushed to the remote without problems. However, all commits in my feature branch are also pushed. I do not want this. In my remote repository I only want to see a 'clean' master branch. My feature branch contains all kinds of intermediate commits. Obviously these are not needed and confusing in my remote repository.
I use TortoiseGit 1.8.15.0. When I 'push' my changes, the 'Ref' section of the popup window shows Local=master, Remote=master. Also, 'Push all branches' is not checked (default). In the bottom section of the window everything is at the default, which means that only 'Autoload Putty Key' is checked.
What am I doing wrong and how could I achieve a 'clean' master branch on my remote?
Additional info: my branch structure looks like the one on the git-merge man page
A---B---C feature1
/ \
D---E---F---G---H master