J Doe
J Doe

Reputation: 149

Are Git Commits Saved/Persistant?

Are Git Commits Saved/Persistant? So, if my computer reboots my commits are still there ready to be pushed to a remote repository? Or do I have to push every time I want to turn off my computer?

I am working on WIndows 10, but I would like to know if the answer also applies to Linux.

Edit:

If I reboot my computer. would I have to re-stage and commit before pushing to a remote repository?

Upvotes: 0

Views: 944

Answers (1)

Steven W. Klassen
Steven W. Klassen

Reputation: 1571

Any git commit will be on your disk and hence persistent. You do not need to re-stage or re-commit just because you haven't pushed.

I actually do this all the time where I commit locally because I want to essentially save my state but I don't push my change to our server if my code is in a temporary state and I know it won't pass the CI.

Upvotes: 1

Related Questions