Is Git's commit atomic?

An update hook can reject parts of a commit and allow others.

update() in receive_pack.c runs in a loop which then calls the update hook possibly multiple times during a commit. Each time the update hook is called, it can return failure, seemingly allowing some refs to be updated and some not updated if rejected.

  • Laravel 5 packages, how to develop over?
  • How to get a git subtree diff?
  • Can't start Git in OS X El Capitan
  • How do I properly rebase a git's branch into another?
  • How to determine if git repository is empty
  • Is there a way to get git to autocomplete commands based on a shortened version?
  • Does Git’s feature of an update hook allowing possibly part of a commit to succeed and some fail mean that Git’s commit is not atomic?

    Or what am I missing here? Thanks.

  • How to Prevent Garbage Collection in GIT?
  • Git push over HTTP not activating remote hooks
  • How to rename a remote git branch name
  • using git to selectively push certain files but then I can't checkout another branch
  • Git cant diff or merge .cs file in utf-16 encoding
  • private repo is getting cloned via ansible playbook but private gem are not getting installed
  • One Solution collect form web for “Is Git's commit atomic?”

    Yes commits are atomic. It is not possible to reject part of a commit.

    The update hook may be called multiple times during a single push (not
    commit) if multiple branches are being pushed at the same time. This allows
    accepting updates to some branches while rejecting updates to others, but each
    accepted update will still point to a complete commit from the pushing
    repository.

    Git Baby is a git and github fan, let's start git clone.