" /> version control - Comment forcer "git pull" pour écraser les fichiers locaux | 2022 codeprofesseur

version control - Comment forcer "git pull" pour écraser les fichiers locaux

Mots clés : gitversion-controloverwritegit-pullgit-fetchgit

meilleur 5 Réponses version control - Comment forcer "git pull" pour écraser les fichiers locaux

vote vote

93

git fetch --all 
git branch backup-master 
git reset --hard origin/master 
git reset --hard origin/<branch_name> 
git checkout master git branch new-branch-to-save-current-commits git fetch --all git reset --hard origin/master 
git stash 
git stash pop 
vote vote

82

git reset --hard HEAD git pull 
vote vote

76

# WARNING: this can't be undone!  git reset --hard HEAD git clean -f -d git pull 
git clean -n -f -d 
Would remove untracked-file-1.txt Would remove untracked-file-2.txt Would remove untracked/folder ... 
vote vote

61

 git add *  git commit -a -m "local file server commit message" 
 git fetch origin master  git merge -s recursive -X theirs origin/master 
vote vote

56

git fetch --all git reset --hard origin/master 
git fetch origin master git reset --hard origin/master 

Questions similaires