===How to Use GIT with SSH key=== When developing applications involving multiple developers, the management of source code can be effectively realized in version system, in our case [[https://en.wikipedia.org/wiki/Git|GITu]]. It can also conveniently ensure the distribution of source code between e.g. home computer, workstation in classroom and MZAPO development kits from single git repository. For teaching and project needs at FEL, GIT repository hosting and management is provided by [[https://gitlab.fel.cvut.cz|GitLab]] After signing up with CTU, FEL students can use GitLab for their projects. If you do not have (re)set GitLab local password use SSO login button for your authentization. For convenient work with a GIT repository, it is recommended to register your public SSH key in the Git server ([[https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key|SSH key]]). If you don't already use an SSH key, you can create one (in Linux) by using the ''ssh-keygen'' command, following instructions in [[..:remote:start|Remote access]]. By default, the public and private parts of the key are saved to the directory ''.ssh'' in your home directory: ssh-keygen cat ~/.ssh/id_rsa.pub Public part of the key (''id_rsa.pub'') register in your GitLab profile - by no means include a private part (''id_rsa'') of your key: Your profile icon at right top corner -> Settings -> SSH keys ===GitLab Protected Branch=== The branch ''master'' is protected against retroactive change of a previously written history after the creation of a repository. If you need to remove something from its history and take a different path, then you need to abolish the protection set. Branch protection settings and cancellations are specified in the Settings -> Repository -> Protected Branches section of GitLab. Be careful with use, you disrupt history for other repository checkout and ''git reset origin/master`` would be necessary for others to get on the track again probably. {{ ..:..:..:documentation:githowto:gitlab-unprotect.png?400 |}} ===Related Resources=== * GIT homepage [[https://git-scm.com/|https://git-scm.com/]], there is available a the book [[https://git-scm.com/book/en/v2|Pro Git]] and other comprehensive documentation. * [[http://excess.org/article/2008/07/ogre-git-tutorial/|Git The Basics Tutorial]], prepared for Ottawa Group of Ruby Enthusiasts by [[https://www.openhub.net/accounts/bartman|Bart Trojanowski]] (local copy [[https://support.dce.felk.cvut.cz/osp/prednasky/intro-to-git.pdf|PDF]]) * [[http://nvie.com/posts/a-successful-git-branching-model/|GitFlow]] one of the most proven development models. * Blog post [[https://chris.beams.io/posts/git-commit/|how to write git commit messages]].