This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| computing:git [2013/09/26 18:30] – [CMSSW and github] clange | computing:git [2017/03/04 15:20] (current) – [CMSSW and github] iwn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== CMSSW and github ====== | ====== CMSSW and github ====== | ||
| - | + | | |
| - | | + | * [[https:// |
| - | * How to add collaborators: | + | * [[http:// |
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[computing: | ||
| ====== SVN switcher guide ====== | ====== SVN switcher guide ====== | ||
| Line 28: | Line 31: | ||
| https:// | https:// | ||
| + | ====== 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:// | ||
| + | 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", | ||