Does git eliminate files when deleted from a remote machine?

I have a web server with Apache and PHP. I want to know if Git is interrupting file access during the pull process.

+3


source to share


1 answer


git pull

is actually a shortcut to two commands:

This fetches files from remote. You have a chance to interrupt it.

git fetch

      

This merges the changes into your local branch. Done in milliseconds



git merge

      

So, about the ability to trim files:

  • As Thomas Kilian says, a git process starts a separate thread in it. So it's not easy to interrupt.
  • If you interrupt git pull

    (close your console, or your internet connection drops, or whatever), you actually interrupt git fetch

    . Since the fetch is incomplete, no truncated files will be merged into your branch. Repeat git fetch

    or git pull

    , let it finish and you have valid copies of your files.
  • If by accident git was able to merge an invalid state (say, the power went out during the merge), you always have a previous commit. Do it git reset --hard <last-valid-commit-sha1>

    .
+3


source







All Articles