Skip to content

Instantly share code, notes, and snippets.

@sylvaincombes
Created February 20, 2018 09:32
Show Gist options
  • Save sylvaincombes/f87bcbc1752f015dcccb3784b1b44c96 to your computer and use it in GitHub Desktop.
Save sylvaincombes/f87bcbc1752f015dcccb3784b1b44c96 to your computer and use it in GitHub Desktop.
temp git pull on one file
#!/usr/bin/env bash
git fetch --all # read distant git datas
git checkout origin/master -- composer.lock # get only the composer.lock file from origin/master
# [do your things]
git reset HEAD composer.lock # cancel operations on composer.lock file
git checkout composer.lock # reset composer.lock file to the previous state (back to a clean git status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment