I have made two commits in my git repository and push them to my git server
the two commits are
now on the other development server I want to pull only the first commit or FILE A from git server. How to do this ?
The short answer is: you cannot pull a specific commit from a remote. However, you may fetch new data from the remote and then use git-checkout COMMIT_ID to view the code at the COMMIT_ID .
git checkout origin/master -- path/to/file // git checkout / -- path/to/file will checkout the particular file from the downloaded changes (origin/master). That's it!
This doesnt make to much sense - if you commited the files you have them in your repo anyway.
Maybe this is what you want
git checkout -- FileAOnly
Or
git checkout origin/master -- FileAonly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With