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/12/05 17:44] – ngadiuba | computing:git [2017/03/04 15:20] – [CMSSW and github] iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== CMSSW and github ====== | ====== CMSSW and github ====== | ||
- | + | <WRAP column 50%> | |
- | * CMSSW github FAQ: http:// | + | * [[http:// |
- | * How to add collaborators: | + | * [[https:// |
- | * Git Book: [[http:// | + | * [[http:// |
+ | * [[https:// | ||
+ | * [[https:// | ||
* [[computing: | * [[computing: | ||
+ | </ | ||
+ | <WRAP column 50%> | ||
+ | {{ computing: | ||
+ | </ | ||
====== SVN switcher guide ====== | ====== SVN switcher guide ====== | ||
Line 30: | Line 35: | ||
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", |