Changes between Version 7 and Version 8 of ClusterGit


Ignore:
Timestamp:
05/22/11 04:35:04 (3 years ago)
Author:
digimer
Comment:

Fixed the last copy from the old wiki to work on the new Trac syntax.

Legend:

Unmodified
Added
Removed
Modified
  • ClusterGit

    v7 v8  
    11= Using git with the Cluster Project = 
     2First we need to setup your git username and email address (for commits), run the following commands with your name and email address: 
    23 
    3 First we need to setup your git username and email address (for commits), run the following commands with your name and email address: 
    44{{{ 
    55git config --global user.name "Your Name Comes Here" 
    66git config --global user.email you@yourdomain.example.com 
    77}}} 
     8Next you want to make sure that you have a copy of the repository local on your machine: 
    89 
    9 Next you want to make sure that you have a copy of the repository local on your machine: 
    1010{{{ 
    11 [cfeist@gold ~]$ git clone ssh://sources.redhat.com/git/cluster.git 
     11[cfeist@gold ~]$ git clone ssh://git.fedorahosted.org/git/cluster.git 
    1212}}} 
    1313or if you only want read only access use this command: 
     14 
    1415{{{ 
    15 [cfeist@gold ~]$ git clone git://sources.redhat.com/git/cluster.git 
     16[cfeist@gold ~]$ git clone git://git.fedorahosted.org/git/cluster.git 
    1617}}} 
    1718Once you have the cluster repository local to your machine you can list the available branches: 
     19 
    1820{{{ 
    1921[cfeist@gold ~]$ cd cluster 
     
    3739}}} 
    3840So for this example we want to make a change to the RHEL46 branch, first we need to create a local branch that tracks the remote RHEL46 branch and then switch to that branch (ie. check it out). 
     41 
    3942{{{ 
    4043[cfeist@gold cluster]$ git branch --track my46 origin/RHEL46 
     
    4649 
    4750If you want to commit every changed file use this command: 
     51 
    4852{{{ 
    4953git commit -a 
    5054}}} 
    5155If you want to commit only certain changed files use these commands: 
     56 
    5257{{{ 
    5358git add file1 file2 file3 
     
    5560}}} 
    5661Now you have all the changes committed locally, but they're not in the official upstream repository.  Once you have all your commits working, then you can push them all at once to the upstream repository with the following command: 
     62 
    5763{{{ 
    58 git push ssh://sources.redhat.com/git/cluster.git my46:RHEL46 
     64git push ssh://git.fedorahosted.org/git/cluster.git my46:RHEL46 
    5965}}} 
     66 
     67If this command fails it is usually because newer changes have already been committed on the RHEL46 branch.  To get these into your local repository you should run the following commands: 
     68 
     69{{{ 
     70git fetch 
     71git rebase origin/RHEL46 
     72git push ssh://git.fedorahosted.org/git/cluster.git my46:RHEL46 
     73}}} 
     74 
    6075If you already have a local repository, but you just want to re-sync it to our main repository you just need to run this command (from within the cluster directory): 
     76 
    6177{{{ 
    6278git pull 
    6379}}} 
    64 There's also all sorts of ways to pull patches from other branches, etc.  But that's beyond the scope of this short email.  You can find more in-depth tutorials, etc. here - http://git.or.cz/gitwiki/GitDocumentation 
     80There's also all sorts of ways to pull patches from other branches, etc.  But that's beyond the scope of this short wiki page. 
     81 
     82 * DavidTeigland has done a write up about some good practices for using git here: https://www.redhat.com/archives/cluster-devel/2008-March/msg00029.html 
     83 * A step-by-step workflow for working with cluster git trees can be found here: ClusterGit/ExampleWorkflow 
     84 * You can find more in-depth tutorials, etc. here: http://git.or.cz/gitwiki/GitDocumentation