User Tools

Site Tools


computing:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:git [2013/09/26 18:30] – [CMSSW and github] clangecomputing:git [2017/03/04 15:20] (current) – [CMSSW and github] iwn
Line 1: Line 1:
 ====== CMSSW and github ====== ====== CMSSW and github ======
- +  [[http://cms-sw.github.io/cmssw/faq.html|CMSSW github FAQ]] 
-  CMSSW github FAQ: http://cms-sw.github.io/cmssw/faq.html +  * [[https://help.github.com/articles/how-do-i-add-a-collaborator|How to add collaborators]] 
-  * How to add collaborators: https://help.github.com/articles/how-do-i-add-a-collaborator+  * [[http://git-scm.com/book|Git Book]] 
 +  * [[https://education.github.com/git-cheat-sheet-education.pdf|Git Cheat Sheet]] 
 +  * [[https://indico.cern.ch/conferenceDisplay.py?confId=286055|Git tutorial]] 
 +  * [[computing:git:basics|Basic git commands to work with CMSSW]]
  
 ====== SVN switcher guide ====== ====== SVN switcher guide ======
Line 28: Line 31:
 https://cern.service-now.com/service-portal/faq.do?se=git-service https://cern.service-now.com/service-portal/faq.do?se=git-service
  
 +====== Private copy of a repository and pull requests ======
 +
 +Instead of directly pulling and pushing changes to a project repository, it is much safer to work on a private copy (called fork) on the github server and transfer changes only via pull request from the privat repository to the project repository on the server.
 +
 +1. Go to
 +https://github.com/cms-edbr/ExoDiBosonResonances
 +and click on "Fork" and choose you user area on github.
 +
 +2. Clone code from your private copy of the repository
 +
 +<code>
 +export GITUSER=`git config user.github`
 +echo "Your github username has been set to \"$GITUSER\""
 +git clone git@github.com:$GITUSER/ExoDiBosonResonances
 +cd ExoDiBosonResonances
 +</code>
 +
 +This command will also give this repository the name "origin".
 +
 +3. Make an alias to the main repository
 +
 +<code>
 +git remote add cms-edbr git@github.com:cms-edbr/ExoDiBosonResonances
 +</code>
 +
 +You can check the result of this command by typing
 +
 +  git remote -v
 +
 +4. Update to the edbr_tautau branch (this will move the HEAD):
 +
 +  git co edbr_tautau
 +
 +Fetch latest changes in branch edbr_tautau from the main repository
 +
 +  git fetch cms-edbr edbr_tautau
 +
 +and merge
 +
 +  git merge edbr_tautau cms-edbr/edbr_tautau
 +  git merge FETCH_HEAD origin/master #generally
 +
 +To preview what this would do you can try
 +
 +  git log ..cms-edbr/edbr_tautau
 +  git diff ...cms-edbr/edbr_tautau #used to be FETCH_HEAD
 +
 +5. Make local changes, add these files for a commit and commit
 +
 +<code>
 +git add some_modified_file
 +git status
 +git commit -m"message"
 +</code>
 +
 +6. Push changes in edbr_tautau branch to you private repository on github server
 +
 +<code>
 +git push origin edbr_tautau
 +git push origin master #generally
 +</code>
  
 +7. Got to you private respository
 +https://github.com/GITUSER/ExoDiBosonResonances
 +and make a pull request to move your changes to the project repository by clicking on "Pull Request", "New Pull Request", "Edit", and select the edbr_tautau branch in both repositories. You may have to click on "Edit" twice to do so. You may either ask someone else to "Merge" this pull request or do it by yourself if you have the rights and are confident.
computing/git.1380213039.txt.gz · Last modified: 2013/09/26 18:30 by clange