Changes between Version 15 and Version 16 of versionControl/git


Ignore:
Timestamp:
Jan 21, 2017 11:31:29 AM (5 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • versionControl/git

    v15 v16  
    570570
    571571
    572 = GitHub =
     572= Github =
    573573
    574574Version control really comes into its own when we begin to collaborate with other people. We already have most of the machinery we need to do this; the only thing missing is to copy changes from one repository to another.
    575575
    576 Systems like Git allow us to move work between any two repositories. In practice, though, it’s easiest to use one copy as a central hub, and to keep it on the web rather than on someone’s laptop. Most programmers use hosting services like GitHub, BitBucket or GitLab to hold those master copies;
     576Systems like `Git` allow us to move work between any two repositories. In practice, though, it’s easiest to use one copy as a central hub, and to keep it on the web rather than on someone’s laptop. Most programmers use hosting services like `GitHub`, `BitBucket` or `GitLab` to hold those master copies.
    577577
    578578
     
    665665The origin/master and master branches now point to the same commit, and you are synchronized with the upstream developments.
    666666
     667== Git pull ==
     668
     669Merging upstream changes into your local repository is a common task in Git-based collaboration workflows. We already know how to do this with git fetch followed by git merge, but git pull rolls this into a single command.
     670
     671
     672Fetch the specified remote’s copy of the current branch and immediately merge it into the local copy. This is the same as `git fetch <remote>` followed by `git merge origin/<current-branch>`.
     673
     674{{{
     675git pull <remote>
     676}}}
     677
     678Instead of using git merge to integrate the remote branch with the local one, use `git rebase`.
     679
     680{{{
     681git pull --rebase <remote>
     682}}}
     683
    667684== Git push ==
    668685
    669 Merging upstream changes into your local repository is a common task in Git-based collaboration workflows. We already know how to do this with git fetch followed by git merge, but git pull rolls this into a single command.
    670 
    671 
    672 Fetch the specified remote’s copy of the current branch and immediately merge it into the local copy. This is the same as git fetch <remote> followed by git merge origin/<current-branch>.
    673 
    674 {{{
    675 git pull <remote>
    676 }}}
    677 
    678 Instead of using git merge to integrate the remote branch with the local one, use git rebase.
    679 
    680 {{{
    681 git pull --rebase <remote>
    682 }}}
    683 
    684 == Git push ==
    685 
    686686Pushing is how you transfer commits from your local repository to a remote repo. It's the counterpart to git fetch, but whereas fetching imports commits to local branches, pushing exports commits to remote branches. This has the potential to overwrite changes, so you need to be careful how you use it.
    687687
     
    707707git push <remote> --tags
    708708
     709{{{
     710{{{#!comment
     711}}}
     712
    709713=== Keep your fork synced ===