Commit vs push and stash in git

20,694

Push and pull are specific to decentralized Version Control Systems.

You should read this book http://book.git-scm.com/ It explains all you need to know

With DCVSs, the repository is local. If you just commit, it won't be shared on the remote server.

The push command sends your local commits to the remote server, and merges them.

Pull = Fetch + Merge Git gets the commits from the remote server (fetch) as a remote tracking branch, then merges them in your branch.

Stashing is a special feature. It allows you to store your uncommited modifications into a stash, and deletes it from the branch you are working on. You can retreive them later by applying the stash.

It's really useful when you're in the middle of a big change, and you just want to do a quick fix. You just have to stash you changes, write the fix, commit it and then applying your saved stash to go back to your work.

Share:
20,694

Related videos on Youtube

Simon Sheehan
Author by

Simon Sheehan

Updated on September 17, 2022

Comments

  • Simon Sheehan
    Simon Sheehan almost 2 years

    I want to learn a little about git. I know a decent amount of svn so i understood the tortoiseGit interface. What i don't understand is the pull VS fetch and the push. What is the difference between commit and push? what is pull vs fetch? and what is this stash save and apply?