Here is the complete solution for pulling and pushing only a particular file inside git repository:
- First you need to clone git repository with a special hint –no checkout
git clone --no-checkout <git url>
- The next step is to get rid of unstaged files in the index with the command:
git reset
- Now you are allowed to start pulling files you want to change with the command:
git checkout origin/master <path to file>
- Now the repository folder contains files that you may start editing right away. After editing you need to execute plain and familar sequence of commands.
git add <path to file>
git commit -m <message text>
git push