Changes between Version 46 and Version 47 of SourceCodeGit


Ignore:
Timestamp:
Nov 10, 2014, 7:05:31 AM (9 years ago)
Author:
Eric Myers
Comment:

Examples of how to compare the local repo to the remote master, and how to pull changes from the remote into the local, so as to keep up to date with the developers.

Legend:

Unmodified
Added
Removed
Modified
  • SourceCodeGit

    v46 v47  
    3333using the appropriate git command - without
    3434needing to contact the Git repository server again as all the history can be found under 'boinc/.git'.
    35 This is called 'checking out'.
    36 
    37 Run `git status` to see whether there are any changes relative to the HEAD of the 'remote master branch':
    38 
    39 {{{
    40 $ cd boinc
    41 
    42 $ git status
    43 # On branch master
    44 nothing to commit, working directory clean
    45 }}}
     35This is called 'checking out'.   
     36See the instructions below for checking out different branches or tags.
    4637
    4738Sometimes it is necessary to purge all untracked files created by build tools
     
    5243}}}
    5344
     45
     46=== Staying Current ===
     47
     48The local git repository which you created when you cloned the remote repository has a complete snapshot of development at the time it was cloned.   
     49You can use this to build the BOINC software, and you can even make local changes to your local copy.
     50Meanwhile the BOINC developers will be making changes to the remote repository as they continue working on the software.   
     51To see what changes have been made there since you cloned the repository you must first "fetch" the changes from that repository. 
     52These will go into a branch called "origin/master", which is not the current working branch of your repository (which by default will be the "master" branch). 
     53So to compare your local copy with the remote, follow this example:
     54{{{
     55$ cd boinc
     56$ git fetch
     57$ git diff --name-status master..origin/master
     58M       client/app.cpp
     59M       client/app_config.cpp
     60M       client/client_types.h
     61M       client/cpu_sched.cpp
     62M       client/cs_prefs.cpp
     63M       client/cs_scheduler.cpp
     64M       client/result.cpp
     65M       client/result.h
     66M       client/rr_sim.cpp
     67M       client/sim.cpp
     68M       clientgui/MainDocument.cpp
     69M       doc/versions.inc
     70M       html/user/get_passwd.php
     71M       html/user/server_status.php
     72M       lib/coproc.h
     73}}}
     74The "--name-status" flag causes only the name and status of differing files to be displayed. 
     75The "master..origin/master" specification causes the difference to be displayed between your local repository (the "master" branch) and the remote repository (as fetched onto the local "origin/master" branch).
     76
     77If you wish to update your local branch to match the remote repository then simply use the git "pull" command,
     78as in this example:
     79{{{
     80$ git pull
     81Updating 6790085..2bb3e74
     82Fast-forward
     83 client/app.cpp              |   2 +-
     84 client/app_config.cpp       |  12 ++
     85 client/client_types.h       |   2 +-
     86 client/cpu_sched.cpp        |  12 +-
     87 client/cs_prefs.cpp         |   5 +-
     88 client/cs_scheduler.cpp     |  15 +-
     89 client/result.cpp           |   7 +-
     90 client/result.h             |   3 +
     91 client/rr_sim.cpp           |   4 +-
     92 client/sim.cpp              |   6 +-
     93 clientgui/MainDocument.cpp  |  12 +-
     94 doc/versions.inc            | 380 ++++++++++++++++++++++----------------------
     95 html/user/get_passwd.php    | 101 ++++++------
     96 html/user/server_status.php |  38 ++++-
     97 lib/coproc.h                |   5 +
     98 15 files changed, 332 insertions(+), 272 deletions(-)
     99}}}
     100You could also use the "git merge" command, which would merge the changes from your local copy of the "origin/master" branch into your local "master" branch.
     101The "git pull" command is shorthand for "git fetch" followed immediately by "git merge".   
     102
     103
    54104== Installing Git ==
    55105
     
    59109  (see this [SourceCodeGit/Windows guide for Windows]).
    60110 * On Linux, Git is usually provided by your distribution.
    61    If not, check your package manager and look for "git" or "git-core".
     111   If it is not already installed, check your package manager and look for "git" or "git-core".
    62112 * On Mac OS X, use [http://www.macports.org MacPorts]
    63113   (to keep Git up to date, recommended) or a manual
     
    67117   [http://gitx.laullon.com GitX] ([https://github.com/laullon/gitx latest])
    68118
    69 To get a copy of the BOINC source code you don't need to fully understand Git, just skim the instructions below.
     119To get a copy of the BOINC source code you don't need to fully understand Git, you can just skim the instructions below.
    70120However, if you intend to modify BOINC or to look at branches, you'll need to know at least the basics.
    71121