git pull: replace local version with the remote version

git fetch origin
git reset --hard origin/master

Here is the good explanation about git pull git pull

The git fetch command imports commits from a remote repository into your local repo. The resulting commits are stored as remote branches instead of the normal local branches that we’ve been working with. This gives you a chance to review changes before integrating them into your copy of the project.

Command git pull <remote> fetches the specified remote’s copy of the current branch and immediately merge it into the local copy. This is the same as git fetch <remote> followed by git merge origin/<current-branch>. Since it is doing merge your commits were still there.

After doing fetch you can reset your working copy with reset command. Hard is to ignore any changes in your local copy. git reset --hard origin/master

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)