0

I have some problems with my project so i need to pull all from master again.

When i type git pull it give me that is everything is all up to date, but i can see on my project that my project have some issues on my local.

How i can pull all from master, but i need to rewrite all files from master to my localhost?

Really important is that i need to rewrite files just on my local from master, because i work for company and if anything happen to project it will be my foul :)

I have tried with --hard too, but nothing changes.

GhostCat
  • 137,827
  • 25
  • 176
  • 248
Php numb
  • 11
  • 3
  • 1
    Are you sure you know what pull does? I can definitely say git pull doesn't fix issues. – evolutionxbox Aug 29 '18 at 08:49
  • Well if i overwrite all files and folders with master it will fix all, on git is everything correct so i want to reset all project on my localhist. – Php numb Aug 29 '18 at 09:00
  • 1
    Possible duplicate of [How do I force "git pull" to overwrite local files?](https://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files) – franiis Aug 29 '18 at 09:13
  • I slightly improved readability of your question, but agree with the given comments: either this is a duplicate of that given question, or you would need to provide more information (if so, please read [mcve] and provide more information within the question, for example results of `git status` and so on) – GhostCat Aug 29 '18 at 11:37
  • I would try `git clean -fdx .` under project dir. It removes everything not available in git repo (after `git reset --hard`). – sardok Aug 29 '18 at 11:44

1 Answers1

0

To make your local master identical to its remote counterpart :

# let's save your local changes (if any)
git stash

# make sure to be on master branch
git checkout master

# let's save your current master branch (to allow for rollback)
git branch backup_old_master

# make sure to get last version of remotes
git fetch

# reset to remote version
git reset --hard origin/master
Romain Valeri
  • 19,645
  • 3
  • 36
  • 61