G
G
German2021-06-23 02:59:12
git
German, 2021-06-23 02:59:12

Git pull not working?

Hello.
I created a remote and local repository.
Created a README.md file in the local repository and pushed it to the remote one.
I deleted a file in the local repository and I want to return it from the remote one again.
Writing:

PS D:\VS\UnknownEngine> git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    README.md

no changes added to commit (use "git add" and/or "git commit -a")
PS D:\VS\UnknownEngine> git pull
Already up to date.
PS D:\VS\UnknownEngine> git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    README.md

no changes added to commit (use "git add" and/or "git commit -a")


Also tried doing this:
PS D:\VS\UnknownEngine> git fetch origin
PS D:\VS\UnknownEngine> git merge origin/master
Already up to date.
PS D:\VS\UnknownEngine> git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    README.md

no changes added to commit (use "git add" and/or "git commit -a")


As a result, nothing changes.
Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-06-23
@mrjbom

Because pull pulls new commits from the remote repository. There are no new commits there.

I deleted a file in the local repository and I want to ... return it.

use " git restore ..." to discard changes in working directory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question