How to deal with GITHUB for CRAB

# update your local repository:
git pull --rebase upstream master


# update my remote fork fork to the upstream master discarding any local change:

 cd /tmp/belforte
 git clone git@github.com:dmwm/CRABServer.git
 cd CRABServer/
 git push --force git@github.com:belforte/CRABServer.git 

# update my local repository
 cd <directory-of-the-local-clone-of-my-fork>
 git checkout --force origin/master




da Eric:

The setup should be like this (pseudo-code)

git clone github/belforte/crab (is now called “origin”)
git add remote upstream github/dmwm/crab (is now called upstream)

Then when your repository is out of date with the central:

git checkout master
git fetch upstream            # fetch commits history
git fetch --tags upstream     # also the tags (need two commands)
git merge upstream master     # merge upstream on your local
git push  origin              # move those changes up
git push --tags origin        # also the tags

To develop something (version 1)

git checkout master # start with latest master
git checkout -b my_feature # checkout and start a new branch
git push --set-upstream origin my_feature # track new branch in your github
# [code]
git commit -m “My feature is awesome”
git push origin # put on your github

Then visit github and make a pull request.

To develop something (version 2)
git checkout master
git checkout -b my_feature
# code
git commit -m “My feature is awesome”
git push origin my_feature  # i.e. use the name of the branch

Then visit github and make a pull request.


You’ll notice in my schemed your changes follow this route:

begin on local branch
pushed to remote branch
pulled/merged onto upstream (DMWM repo) by Marco
only arrive on your local master with the merge of upstream/master
then pushed to your github master


Se il mio repository locale master branch e' pieno di schifezze e voglio
resettarlo.
1. sistemo il master in origin come scritto all'inizio di questo file
2. forzo il mio master locale con git reset --hard origin/master
vedi: http://stackoverflow.com/questions/1125968/force-git-to-overwrite-local-files-on-pull


per fare una PR per un branch specific, e.g. per 1.1.0_crab in WWCore, da Eric:


git checkout crab-branch (or git checkout --track upstream/crab-branch if you don't have crab-branch already)
git checkout -b crab_version_of_feature
git cherry-pick [commit number(s) for feature from master branch]
git push

Now go to GitHub and create a pull request but use the dropdown members to request it be merged on crab-branch instead of master
from Alan Malta Rodrigues
BTW, on the steps Eric listed above, I usually run a
git pull
or
git pull origin crab_branch

before creating the new feature branch.

and
 I suggest you to always start with the master PR, such that you can wait for jenkins to finish to check whether your PR is "sane" and doesn't fail unit tests. Once you're sure it's fine, you can cherry-pick it in the crab branch.

-- StefanoBelforte - 2018-01-23

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2018-02-27 - LeonardoCristella
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback