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
- 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
- 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
git commit -m
git push