Matus Dubrava
Matus Dubrava

Reputation: 14482

some files from github repo are not being pulled

I have tried to synchronize my local machine with a remote Github repo and everything went ok, except some (not all) new folders have not been pulled and if I now try to pull again, I get the message saying that my local is already up to date.

I have used command

git pull origin master 

When I go to my VS Code editor and point to the changes in that repo, it also shows that my local and remote are synchronized, which clearly is not the case (at least from my perspective, since I am missing some folders on my local that are present on remote).

I didn't find anything mentioning something like this. Anyone knows where the error may be, or at least where to look?

Upvotes: 2

Views: 1837

Answers (2)

coreyward
coreyward

Reputation: 80090

The situation you're describing is, quite simply, not possible. That's good news. It means you're merely missing something.

  1. Are the folders empty? Git tracks files, so if you have an empty folder, it doesn't exist as far as git is concerned.

    You will often see people use a hidden file like .keep inside of a folder that they want to ensure is committed to the repo but doesn't have any other files. You can create one (on *nix/mac) by running touch your_folder/.keep.

  2. If there are files in the folders, are they committed to the repository? Running git status can help you find out, but isn't always going to show. They could be ignored by git due to settings. The easiest way to check: git ls-files will list all of the files git is tracking.

    You can also list ignored files along with the source of the ignore rule with git check-ignore -v * (mac/unix only I believe), which should help you track down the source of the confusion.

  3. Does your remote repository have the same branch checked out as your local copy? Running git branch will show you the current branch if you don't have your shell configured to show this in the prompt.

Upvotes: 1

Sanjay
Sanjay

Reputation: 114

You might need to verify that your remote branch is "master". It could be that you might have pushed code into a different branch in remote and trying to pull it from master.

git pull origin "branch-name"

Upvotes: 0

Related Questions