Pushing / Pulling
What is it?
git language, pushing is the action to send your local changes to the remote server. Taking the example of only a
master branch, you have to keep in mind that there exists a
master branch locally (on your computer) and a
origin/master branch, which is the
master branch of the remote server. And they are indepent, you can think of it as two different branches!
git somewhat “synchronizes” your branch
master with the remote branch
origin/master. Obviously, you can push a different branch than the
can be a bad idea or even not allowed). The command is the following
git push origin master
or even just
pullthe changes before
Pusing is possible only if your branch “more advanced” than remote branch. Sometimes, we first need to
pull the changes before
On your computer and in the folder you just clone, type some modification, commit and then push. Check the changes on your webbrowser.
Obviously, you remote server must point to your account!
What is it?
Pulling the backward operation: applying changes saved on the remote into the local repository (“
origin master” is optional):
git pull origin master
origin/masteras shows below. You just have to
pullthe result after that.
Fetching is actually part of the
git download the history of remote branches and does not modify the local branches. Said otherwise,
is somewhat equivalent to
git fetch git merge