This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
computing:git [2013/05/15 18:33] – clange | computing:git [2017/03/04 15:20] – [CMSSW and github] iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CMSSW and github ====== | ||
+ | <WRAP column 50%> | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[computing: | ||
+ | </ | ||
+ | <WRAP column 50%> | ||
+ | {{ computing: | ||
+ | </ | ||
+ | ====== SVN switcher guide ====== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | |||
+ | ====== cms-uzh repository at CERN ====== | ||
- | ====== Cloning the repository | + | ===== Cloning the repository ===== |
There are two ways to clone the repository: | There are two ways to clone the repository: | ||
Line 9: | Line 27: | ||
</ | </ | ||
- | ====== Web access to the repository | + | ===== Web access to the repository ===== |
https:// | https:// | ||
- | ====== CERN Knowledge Base on git service | + | ===== CERN Knowledge Base on git service ===== |
https:// | https:// | ||
- | ====== | + | ====== |
- | http://git.or.cz/ | + | 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:// | ||
+ | and click on " | ||
+ | 2. Clone code from your private copy of the repository | ||
+ | |||
+ | < | ||
+ | export GITUSER=`git config user.github` | ||
+ | echo "Your github username has been set to \" | ||
+ | git clone git@github.com: | ||
+ | cd ExoDiBosonResonances | ||
+ | </ | ||
+ | |||
+ | This command will also give this repository the name " | ||
+ | |||
+ | 3. Make an alias to the main repository | ||
+ | |||
+ | < | ||
+ | git remote add cms-edbr git@github.com: | ||
+ | </ | ||
+ | |||
+ | 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/ | ||
+ | git merge FETCH_HEAD origin/ | ||
+ | |||
+ | To preview what this would do you can try | ||
+ | |||
+ | git log ..cms-edbr/ | ||
+ | git diff ...cms-edbr/ | ||
+ | |||
+ | 5. Make local changes, add these files for a commit and commit | ||
+ | |||
+ | < | ||
+ | git add some_modified_file | ||
+ | git status | ||
+ | git commit -m" | ||
+ | </ | ||
+ | |||
+ | 6. Push changes in edbr_tautau branch to you private repository on github server | ||
+ | |||
+ | < | ||
+ | git push origin edbr_tautau | ||
+ | git push origin master #generally | ||
+ | </ | ||
+ | 7. Got to you private respository | ||
+ | https:// | ||
+ | and make a pull request to move your changes to the project repository by clicking on "Pull Request", |