Changes between Version 17 and Version 18 of Developer/Git/Users


Ignore:
Timestamp:
Jun 2, 2017, 12:44:19 AM (15 months ago)
Author:
Chris Johns
Comment:

Add more detail about using local branchs to the Making Chanages section.

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Git/Users

    v17 v18  
    4141}}}
    4242This command will update all your local branches with any new code revisions available on the central repository.
     43
    4344= Making Changes =
    4445
    45 Git allows you to make changes in the RTEMS source tree and track those changes locally. First you need to clone the repository:
     46Git allows you to make changes in the RTEMS source tree and track those changes locally. We recommend you make all your changes in local branches. If you are working on a few different changes or a progression of changes it is best to use a local branch for each change.
     47
     48A branch for each change lets your repo's master branch track the upstream RTEMS's master branch without interacting with any of the changes you are working on. A completed change is emailed to the developers list for review and this can take time. While this is happening the upstream's master branch may be updated and you may need to rebase your work and test again if you are required to change of update your patch. A local branch isolates a specific change from others and helps you manage the process.
     49
     50First you need to clone the repository:
    4651{{{
    4752 git clone git://git.rtems.org/rtems.git rtems
     
    5156 cd rtems
    5257 git pull
     58}}}
     59Create a local branch to make your changes in, in this example the change is `faster-context-switch`:
     60{{{
     61 git checkout -b faster-context-switch
    5362}}}
    5463Next make your changes to files. If you add, delete or move/rename files you need to inform Git
     
    6271 git commit -a
    6372}}}
    64 The -a flag commits all the changes that were made, but you can also control which changes to commit by individually adding files as you modify them by using. You can also specify other options to commit, such as a message with the -m flag.
     73The `-a` flag commits all the changes that were made, but you can also control which changes to commit by individually adding files as you modify them by using. You can also specify other options to commit, such as a message with the `-m` flag.
    6574{{{
    6675 git add /some/changed/files
    6776 git commit
    6877}}}
    69 But you shouldn't do any of this on the branch that you cloned, instead you should create a new branch to work with, so that the cloned branch (master) is a pristine copy of the upstream RTEMS repository.
     78Create a patch from your branch, in this case we have two commits we want to send for review:
     79{{{
     80 git format-patch -2
     81}}}
     82We could send the patches directly to the developer's list for review:
     83{{{
     84 git send-email --to=devel@rtems.org -2
     85}}}
     86There are new changes pushed to the RTEMS's master branch and our local branch needs to be updated:
     87{{{
     88 git checkout master
     89 git pull
     90 git checkout faster-context-switch
     91 git rebase
     92}}}
    7093
    7194= Working with Branches =
     
    271294 git config --global user.email name@domain.com
    272295}}}
     296
     297Please user a real name, we do not allow pseudonyms or anonymous contributions.
    273298
    274299= Submitting a Patch =