I am new to git.So please forgive for basic question.
I have couple of checkouts of repos: Folder1 is on Server1 and Folder2 is on Server2.
Folder2 only “git pull” changes.
This fetches all files which is checked-in from Folder1.
I want to update only specific file something like “cvs update filename”
cvs update filename
I tried “git checkout -- filename” which simply not doing anything.
I followed these step:s
#Commit and push changes in foo.txt from Folder1 on Server1.
# On Servers
cd Folder2
git checkout -- foo.txt
Above command is just not doing any updates.
If you have push a commit from repo1 to repo2, then repo2 should directly see the updated file.
But just in case, You need to:
Provided that
repo2has a remote named “repo1“.If that remote is named “
origin” (default name), thenIn both cases, to see update on a specific file from a remote repo (like
repo1), you need to fetch that remote repo first intorepo2.