LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to git fetch (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-git-fetch-4175634818/)

bkelly 07-24-2018 12:57 PM

unable to git fetch
 
I created a local repository and command ls -al shows it is .git. I edited a file and want to revert back to the original. The edited version of the file was renamed leaving no file of that name in the directory. I tried these two commands along with some others.

Code:

git fetch .git parser.odt
Code:

git fetch ./.git parser.odt
The response is
Quote:

fatal: Couldn't find remote ref parser.odt
fatal: The remote end hung up unexpectedly
the file was added some days ago with

Code:

git add parser.odt
git commit

The git commit started a vi editor where I edited in comments and saved with ctl-ZZ

What must be changed to get a copy of that file?

EDIT: I am looking at: git --help and the most commonly used commands do not include any command to show what is in the repository. How is that done to ensure that the files were really saved?

Keith Hedger 07-24-2018 05:34 PM

try
Code:

git checkout FILENAME

bkelly 07-26-2018 03:02 PM

Checkout works. But, I don't really want to check it out for editing. I just want a copy of it.


All times are GMT -5. The time now is 08:11 AM.