Sixtrack on Github How to Use GIT(Hub) and the Sixtrack Development Model

Sixtrack on Github How to Use GIT(Hub) and the Sixtrack Development Model

Git(Hub) Development model Using Git(Hub) Summary & Conclusions SixTrack on GitHub How to use GIT(hub) and the SixTrack development model Kyrre Sjobak SixTrack meeting, Sept. 17th 2015 Kyrre Sjobak SixTrack on GitHub SixTrack meeting 1 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Outline 1 Git(Hub) 2 Development model 3 Using Git(Hub) 4 Summary & Conclusions Kyrre Sjobak SixTrack on GitHub SixTrack meeting 2 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is Git? A revision control system! Similar to SVN, except. Much better support for parallel development in branches Distributed: Everyone has a full copy of the whole repository on their workstation A lot faster An extremely powerful tool Built on straight-forward principles Originally developed by Linus Thorvalds for the Linux kernel Very widely used, scaling from small personal codes to huge projects Kyrre Sjobak SixTrack on GitHub SixTrack meeting 3 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is Git? A revision control system! Similar to SVN, except. Much better support for parallel development in branches Distributed: Everyone has a full copy of the whole repository on their workstation A lot faster An extremely powerful tool Built on straight-forward principles Originally developed by Linus Thorvalds for the Linux kernel Very widely used, scaling from small personal codes to huge projects Kyrre Sjobak SixTrack on GitHub SixTrack meeting 3 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is Git? A revision control system! Similar to SVN, except. Much better support for parallel development in branches Distributed: Everyone has a full copy of the whole repository on their workstation A lot faster An extremely powerful tool Built on straight-forward principles Originally developed by Linus Thorvalds for the Linux kernel Very widely used, scaling from small personal codes to huge projects Kyrre Sjobak SixTrack on GitHub SixTrack meeting 3 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is Git? A revision control system! Similar to SVN, except. Much better support for parallel development in branches Distributed: Everyone has a full copy of the whole repository on their workstation A lot faster An extremely powerful tool Built on straight-forward principles Originally developed by Linus Thorvalds for the Linux kernel Very widely used, scaling from small personal codes to huge projects Kyrre Sjobak SixTrack on GitHub SixTrack meeting 3 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is GitHub? Company which offers hosting GIT repositories + tools (issue tracker, wiki, web interface,. ) Free for open-source software Recommended for CERN projects which have outside collaborators For closed projects, CERN hosted GitLab is recommended(a). About 11 million users No risk in using an external provider https://github.com due to GIT’s decentralized model. a) https://cern.service-now.com/service-portal/article.do?n=KB0003132&s=gitlab Kyrre Sjobak SixTrack on GitHub SixTrack meeting 4 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions What is GitHub? Company which offers hosting GIT repositories + tools (issue tracker, wiki, web interface,. ) Free for open-source software Recommended for CERN projects which have outside collaborators For closed projects, CERN hosted GitLab is recommended(a). About 11 million users No risk in using an external provider due to GIT’s decentralized model. a) https://cern.service-now.com/service-portal/article.do?n=KB0003132&s=gitlab Kyrre Sjobak SixTrack on GitHub SixTrack meeting 4 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (1) Commit Fork A set of changes, An independent copy of the labeled by a SHA-1 hash repository Branch Merge A named string of commits Updating one branch using the (label tracks the last commit) changeset in another Kyrre Sjobak SixTrack on GitHub SixTrack meeting 5 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (1) Commit Fork A set of changes, An independent copy of the labeled by a SHA-1 hash repository Branch Merge A named string of commits Updating one branch using the (label tracks the last commit) changeset in another ... Kyrre Sjobak SixTrack on GitHub SixTrack meeting 5 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (1) Commit Fork A set of changes, An independent copy of the labeled by a SHA-1 hash repository Branch Merge A named string of commits Updating one branch using the (label tracks the last commit) changeset in another Kyrre Sjobak SixTrack on GitHub SixTrack meeting 5 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (1) Commit Fork A set of changes, An independent copy of the labeled by a SHA-1 hash repository Branch Merge A named string of commits Updating one branch using the (label tracks the last commit) changeset in another Kyrre Sjobak SixTrack on GitHub SixTrack meeting 5 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (1) Commit Fork A set of changes, An independent copy of the labeled by a SHA-1 hash repository Branch Merge A named string of commits Updating one branch using the (label tracks the last commit) changeset in another Kyrre Sjobak SixTrack on GitHub SixTrack meeting 5 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Basic GIT concepts (2) Working copy Remote A working copy may have one or To use the files in the repository, more remotes. When you create you checkout a specific commit. a working copy by cloning a This fills the working directory remote repository (e.g. a GitHub with files in the state described repository), this becomes the by the commit. default remote. You may synchronize your working copy HEAD with these, fetching in commits The currently checked out from them and pushing commits commit. to them. Kyrre Sjobak SixTrack on GitHub SixTrack meeting 6 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Moving from SVN to GIT: Why Wanted to be able to track multiple parallel branches GIT is faster and more flexible Will make reviewing and merging contributions easier Kyrre Sjobak SixTrack on GitHub SixTrack meeting 7 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Moving from SVN to GIT: How Converted the old SVN repository using git svn Needed to supply a list linking SVN usernames to real names+email All old commits were imported Branches and tags recognized Clean-up: Removed references to old SVN repository in metadata Squash commit #193 with #194 (the line-endings oopsie) Testing & dogfooding. Kyrre Sjobak SixTrack on GitHub SixTrack meeting 8 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions For the impatient: SVN ↔ GIT cheat sheet Download contents of repository: Undo a change: svn checkout URL git revert COMMIT_ID Create a new commit which ↔ git clone URL undoes the changes introduced in COMMIT_ID Update working copy: git reset FILE Reset the contents of the file to last svn update ↔ git pull commited version git clean (-n) Remove untracked files from working See the status of repository: directory (-n: dry-run) svn status ↔ git status svn diff ↔ git diff Branches: svn log ↔ git log Merge two branches: svnstatus Working copy version etc. git merge MERGEFROM Merge branch MERGEFROM into git branch Which branch is in use current branch Change what is tracked: git checkout (-b) BRANCHNAME Switch to branch svn add FILE ↔ git add FILE BRANCHNAME (-b: create it) svn rm FILE ↔ git rm FILE Read the manual: svn mv FILE ↔ git mv FILE svn help COMMAND Commit a change: ↔ git help COMMAND svn commit ↔ git commit FILES && git push Kyrre Sjobak SixTrack on GitHub SixTrack meeting 9 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Our development model Master repository: Upstream https://github.com/SixTrack/SixTrack Contains the released versions in its master branch. Repository maintained by Ricardo and Kyrre. Personal repositories: To add a new feature, create a fork on GitHub. In the newly created personal repository, create a branch. Do your changes in this branch, while your master tracks the upstream master. To get the changes from upstream into your branch, merge upstream’s master into your branch To merge your code into upstream (for a new master release), create a pull request on GitHub. Kyrre Sjobak SixTrack on GitHub SixTrack meeting 10 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Our development model Master repository: Upstream Private https://github.com/SixTrack/SixTrack Contains the released versions in its master branch. Repository maintained by Ricardo and Kyrre. Personal repositories: To add a new feature, create a fork on GitHub. In the newly created personal repository, create a branch. Do your changes in this branch, while your master tracks the upstream master. To get the changes from upstream into your branch, merge upstream’s master into your branch master To merge your code into upstream (for a new master release), create a pull request on GitHub. copy Kyrre Sjobak SixTrack on GitHub SixTrack meeting 10 / 22 Git(Hub) Development model Using Git(Hub) Summary & Conclusions Our development model Master repository: Upstream Private https://github.com/SixTrack/SixTrack Contains the released versions in its master branch. Repository maintained by Ricardo and Kyrre. Personal repositories: To add a new feature, create a fork on GitHub. In the newly created personal repository, create a branch. Do your changes in this branch, while your master tracks the upstream master. To get the changes from upstream into your branch, merge upstream’s master into your branch master,feature To merge your code into upstream (for a new master release), create a pull request on GitHub.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    41 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us