4ndy
4ndy

Reputation: 600

Git ignores local files on PULL

We have a repository with a number of scripts and files in a folder structure. Nothing fancy. There is no .gitignore file as far as I can see. There is an exclude file under .git\info but it looks like a default.

We pull this repository to a local computer (git pull https://accesstoken@url) and that worked fine until a little while ago.

What I mean by that: If I changed the local content and then tried to do a pull, I would get an error that local changes hadn't been committed. (using GIT Bash).

Something has changed, so that now, I can add files (tested PDFs, txts), even edit existing files locally, but a pull request still happily tells me that it is "Already up to date". This happens on all our dev workstations now.

Why?

Upvotes: 0

Views: 84

Answers (1)

battlmonstr
battlmonstr

Reputation: 6300

The normal pattern of using git pull is to have no local changes in the working copy before doing the pull. To avoid having a dirty working copy you need to either commit or stash the changes (or reset them).

An error that local changes hadn't been committed happens if you have a dirty working copy, and you try to pull remote changes that might result in a conflict. As long as your local changes don't interfere with the changes done on the remote side this can actually apply cleanly sometimes.

"Already up to date" happens after all the remote changes were mirrored to your local repository, and you try to pull again.

Upvotes: 2

Related Questions