简体   繁体   中英

What does it mean for a snapshot to be atomic?

In the following command and explanation, what does the qualifier " atomic " mean in " atomic snapshots "? My best guess from the context is something akin to granularity?

git reset <commit>

# Move the current branch tip backward to <commit>, reset the staging 
# area to match, but leave the working directory alone. All changes made 
# since <commit> will reside in the working directory, which lets you 
# re-commit the project history using cleaner, more atomic snapshots.
# since <commit> will reside in the working directory, which lets you 
# re-commit the project history using cleaner, more atomic snapshots.

In that context I think what's meant is that you can reset HEAD to some previous commit, and then squash all your subsequent changes into a single commit. A commit is the smallest unit of change in a git repository, and its often desirable to have a single commit that contains all the changes necessary to add some piece of work to the repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM