diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /doc/university | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'doc/university')
21 files changed, 70 insertions, 1332 deletions
diff --git a/doc/university/README.md b/doc/university/README.md index c815842480c..bf2e7c91918 100644 --- a/doc/university/README.md +++ b/doc/university/README.md @@ -1,8 +1,8 @@ --- -redirect_to: 'index.md' +redirect_to: '../topics/index.md' --- -This document was moved to [another location](index.md). +This document was moved to [another location](../topics/index.md). <!-- This redirect file can be deleted after 2021-05-11. --> <!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/index.md b/doc/university/index.md index 0d194c7708d..60d012485de 100644 --- a/doc/university/index.md +++ b/doc/university/index.md @@ -1,223 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false -type: index +redirect_to: '../topics/index.md' --- -# GitLab University +This document was removed. See our [topics](../topics/index.md) for similar content. -GitLab University is a great place to start when learning about version control with Git and GitLab, as well as other GitLab features. - -If you're looking for a GitLab subscription for _your university_, see our [GitLab for Education](https://about.gitlab.com/solutions/education/) page. - -WARNING: -Some of the content in GitLab University may be out of date and we plan to -[evaluate](https://gitlab.com/gitlab-org/gitlab/-/issues/20403) it. - -The GitLab University curriculum is composed of GitLab videos, screencasts, presentations, projects and external GitLab content hosted on other services and has been organized into the following sections: - -1. [GitLab Beginner](#1-gitlab-beginner). -1. [GitLab Intermediate](#2-gitlab-intermediate). -1. [GitLab Advanced](#3-gitlab-advanced). -1. [External Articles](#4-external-articles). -1. [Resources for GitLab Team Members](#5-resources-for-gitlab-team-members). - -## 1. GitLab Beginner - -### 1.1. Version Control and Git - -<!-- vale gitlab.Spelling = NO --> - -1. [Version Control Systems](https://docs.google.com/presentation/d/16sX7hUrCZyOFbpvnrAFrg6tVO5_yT98IgdAqOmXwBho/edit#slide=id.g72f2e4906_2_29) -1. [Katacoda: Learn Git Version Control using Interactive Browser-Based Scenarios](https://www.katacoda.com/courses/git) - -<!-- vale gitlab.Spelling = YES --> - -### 1.2. GitLab Basics - -1. [An Overview of GitLab.com - Video](https://www.youtube.com/watch?v=WaiL5DGEMR4) -1. [Why Use Git and GitLab - Slides](https://docs.google.com/a/gitlab.com/presentation/d/1RcZhFmn5VPvoFu6UMxhMOy7lAsToeBZRjLRn0LIdaNc/edit?usp=drive_web) -1. [GitLab Basics - Article](../gitlab-basics/index.md) -1. [Git and GitLab Basics - Video](https://www.youtube.com/watch?v=03wb9FvO4Ak&index=5&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) -1. [Git and GitLab Basics - Online Course](https://courses.platzi.com/classes/57-git-gitlab/2475-part-233-2/) -1. [Comparison of GitLab Versions](https://about.gitlab.com/features/#compare) - -### 1.3. Your GitLab Account - -1. [Create a GitLab Account - Online Course](https://courses.platzi.com/classes/57-git-gitlab/2434-create-an-account-on-gitlab/) -1. [Create and Add your SSH key to GitLab - Video](https://www.youtube.com/watch?v=54mxyLo3Mqk) - -### 1.4. GitLab Projects - -1. [Repositories, Projects and Groups - Video](https://www.youtube.com/watch?v=4TWfh1aKHHw&index=1&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) -1. [Creating a Project in GitLab - Video](https://www.youtube.com/watch?v=7p0hrpNaJ14) -1. [How to Create Files and Directories](https://about.gitlab.com/blog/2016/02/10/feature-highlight-create-files-and-directories-from-files-page/) -1. [GitLab To-Do List](https://about.gitlab.com/blog/2016/03/02/gitlab-todos-feature-highlight/) -1. [GitLab Draft Flag](https://about.gitlab.com/blog/2016/01/08/feature-highlight-wip/) - -### 1.5. Migrating from other Source Control - -<!-- vale gitlab.Spelling = NO --> - -1. [Migrating from Bitbucket/Stash](../user/project/import/bitbucket.md) -1. [Migrating from GitHub](../user/project/import/github.md) -1. [Migrating from SVN](../user/project/import/svn.md) -1. [Migrating from Fogbugz](../user/project/import/fogbugz.md) - -<!-- vale gitlab.Spelling = YES --> -### 1.6. The GitLab team - -1. [About GitLab](https://about.gitlab.com/company/) -1. [GitLab Direction](https://about.gitlab.com/direction/) -1. [GitLab Master Plan](https://about.gitlab.com/blog/2016/09/13/gitlab-master-plan/) -1. [Making GitLab Great for Everyone - Video](https://www.youtube.com/watch?v=GGC40y4vMx0) - Response to "Dear GitHub" letter -1. [Using Innersourcing to Improve Collaboration](https://about.gitlab.com/blog/2014/09/05/innersourcing-using-the-open-source-workflow-to-improve-collaboration-within-an-organization/) -1. [The Software Development Market and GitLab - Video](https://www.youtube.com/watch?v=sXlhgPK1NTY&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e&index=6) - [Slides](https://docs.google.com/presentation/d/1vCU-NbZWz8NTNK8Vu3y4zGMAHb5DpC8PE5mHtw1PWfI/edit) -1. [GitLab Resources](https://about.gitlab.com/resources/) - -### 1.7 Community and Support - -1. [Getting Help](https://about.gitlab.com/get-help/) - - Proposing Features and Reporting and Tracking bugs for GitLab - - The GitLab IRC channel, Gitter Chat Room, Community Forum, and Mailing List - - Getting Technical Support - - Being part of our Great Community and Contributing to GitLab -1. [Getting Started with the GitLab Development Kit (GDK)](https://about.gitlab.com/blog/2016/06/08/getting-started-with-gitlab-development-kit/) -1. [GitLab Professional Services](https://about.gitlab.com/services/) - -### 1.8 GitLab Training Material - -1. [Git and GitLab Workshop - Slides](https://docs.google.com/presentation/d/1JzTYD8ij9slejV2-TO-NzjCvlvj6mVn9BORePXNJoMI/edit?usp=drive_web) - -## 2. GitLab Intermediate - -### 2.1 GitLab Pages - -1. [Using any Static Site Generator with GitLab Pages](https://about.gitlab.com/blog/2016/06/17/ssg-overview-gitlab-pages-part-3-examples-ci/) -1. [Securing GitLab Pages with SSL](https://about.gitlab.com/blog/2016/06/24/secure-gitlab-pages-with-startssl/) -1. [GitLab Pages Documentation](../user/project/pages/index.md) - -### 2.2. GitLab Issues - -1. [Markdown in GitLab](../user/markdown.md) -1. [Issues and Merge Requests - Video](https://www.youtube.com/watch?v=raXvuwet78M) -1. [Due Dates and Milestones for GitLab Issues](https://about.gitlab.com/blog/2016/08/05/feature-highlight-set-dates-for-issues/) -1. [How to Use GitLab Labels](https://about.gitlab.com/blog/2016/08/17/using-gitlab-labels/) -1. [Applying GitLab Labels Automatically](https://about.gitlab.com/blog/2016/08/19/applying-gitlab-labels-automatically/) -1. [GitLab Issue Board - Product Page](https://about.gitlab.com/stages-devops-lifecycle/issueboard/) -1. [An Overview of GitLab Issue Board](https://about.gitlab.com/blog/2016/08/22/announcing-the-gitlab-issue-board/) -1. [Designing GitLab Issue Board](https://about.gitlab.com/blog/2016/08/31/designing-issue-boards/) -1. [From Idea to Production with GitLab - Video](https://www.youtube.com/watch?v=25pHyknRgEo&index=14&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) - -### 2.3. Continuous Integration - -1. [Operating Systems, Servers, VMs, Containers and Unix - Video](https://www.youtube.com/watch?v=V61kL6IC-zY&index=8&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) -1. [GitLab CI/CD - Product Page](https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/) -1. [Getting started with GitLab and GitLab CI](https://about.gitlab.com/blog/2015/12/14/getting-started-with-gitlab-and-gitlab-ci/) -1. [GitLab Container Registry](https://about.gitlab.com/blog/2016/05/23/gitlab-container-registry/) -1. [GitLab and Docker - Video](https://www.youtube.com/watch?v=ugOrCcbdHko&index=12&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) -1. [How we scale GitLab with built in Docker](https://about.gitlab.com/blog/2016/06/21/how-we-scale-gitlab-by-having-docker-built-in/) -1. [Continuous Integration, Delivery, and Deployment with GitLab](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/) -1. [Deployments and Environments](https://about.gitlab.com/blog/2021/02/05/ci-deployment-and-environments/) -1. [Sequential, Parallel or Custom Pipelines](https://about.gitlab.com/blog/2016/07/29/the-basics-of-gitlab-ci/) -1. [Setting up GitLab Runner For Continuous Integration](https://about.gitlab.com/blog/2016/03/01/gitlab-runner-with-docker/) -1. [Setting up GitLab Runner on DigitalOcean](https://about.gitlab.com/blog/2016/04/19/how-to-set-up-gitlab-runner-on-digitalocean/) -1. [Setting up GitLab CI for iOS projects](https://about.gitlab.com/blog/2016/03/10/setting-up-gitlab-ci-for-ios-projects/) -1. [IBM: Continuous Delivery vs Continuous Deployment - Video](https://www.youtube.com/watch?v=igwFj8PPSnw) -1. [Amazon: Transition to Continuous Delivery - Video](https://www.youtube.com/watch?v=esEFaY0FDKc) -1. [TechBeacon: Doing continuous delivery? Focus first on reducing release cycle times](https://techbeacon.com/devops/doing-continuous-delivery-focus-first-reducing-release-cycle-times) -1. See **[Integrations](#39-integrations)** for integrations with other CI services. - -### 2.4. Workflow - -1. [GitLab Flow - Video](https://youtu.be/enMumwvLAug?list=PLFGfElNsQthZnwMUFi6rqkyUZkI00OxIV) -1. [GitLab Flow vs Forking in GitLab - Video](https://www.youtube.com/watch?v=UGotqAUACZA) -1. [GitLab Flow Overview](https://about.gitlab.com/topics/version-control/what-is-gitlab-flow/) -1. [Always Start with an Issue](https://about.gitlab.com/blog/2016/03/03/start-with-an-issue/) -1. [GitLab Flow Documentation](../topics/gitlab_flow.md) - -### 2.5. GitLab Comparisons - -1. [GitLab Compared to Other Tools](https://about.gitlab.com/devops-tools/) -1. [Comparing GitLab Terminology](https://about.gitlab.com/blog/2016/01/27/comparing-terms-gitlab-github-bitbucket/) -1. [GitLab Compared to Atlassian (Recording 2016-03-03)](https://youtu.be/Nbzp1t45ERo) -1. [GitLab Position FAQ](https://about.gitlab.com/handbook/positioning-faq/) -1. [Customer review of GitLab with points on why they prefer GitLab](https://www.enovate.co.uk/blog/2015/11/25/gitlab-review) - -## 3. GitLab Advanced - -### 3.1. DevOps - -1. [XebiaLabs: DevOps Terminology](https://digital.ai/glossary) -1. [XebiaLabs: Periodic Table of DevOps Tools](https://digital.ai/periodic-table-of-devops-tools) -1. [Puppet Labs: State of DevOps 2016 - Book](https://puppet.com/resources/report/2016-state-devops-report/) - -### 3.2. Installing GitLab with Omnibus - -1. [What is Omnibus - Video](https://www.youtube.com/watch?v=XTmpKudd-Oo) -1. [How to Install GitLab with Omnibus - Video](https://www.youtube.com/watch?v=Q69YaOjqNhg) -1. [Installing GitLab - Online Course](https://courses.platzi.com/classes/57-git-gitlab/2476-part-0/) -1. [Using a Non-Packaged PostgreSQL Database](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#using-a-non-packaged-postgresql-database-management-server) -1. [Installing GitLab on Microsoft Azure](https://about.gitlab.com/blog/2016/07/13/how-to-setup-a-gitlab-instance-on-microsoft-azure/) -1. [Installing GitLab on Digital Ocean](https://about.gitlab.com/blog/2016/04/27/getting-started-with-gitlab-and-digitalocean/) - -### 3.3. Permissions - -1. [How to Manage Permissions in GitLab EE - Video](https://www.youtube.com/watch?v=DjUoIrkiNuM) - -### 3.4. Large Files - -1. [Big files in Git (Git LFS) - Video](https://www.youtube.com/watch?v=DawznUxYDe4) - -### 3.5. LDAP and Active Directory - -1. [How to Manage LDAP, Active Directory in GitLab - Video](https://www.youtube.com/watch?v=HPMjM-14qa8) - -### 3.6 Custom Languages - -1. [How to add Syntax Highlighting Support for Custom Languages to GitLab - Video](https://youtu.be/6WxTMqatrrA) - -### 3.7. Scalability and High Availability - -1. [Scalability and High Availability - Video](https://www.youtube.com/watch?v=cXRMJJb6sp4&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e&index=2) -1. [High Availability - Video](https://www.youtube.com/watch?v=36KS808u6bE&index=15&list=PLFGfElNsQthbQu_IWlNOxul0TbS_2JH-e) -1. [High Availability Documentation](https://about.gitlab.com/solutions/reference-architectures/) - -### 3.8 Value Stream Analytics - -1. [GitLab Value Stream Analytics Overview (as of 2016)](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/) -1. [GitLab Value Stream Analytics - Product Page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/) - -### 3.9. Integrations - -<!-- vale gitlab.Spelling = NO --> - -1. [How to Integrate Jira and Jenkins with GitLab - Video](https://gitlabmeetings.webex.com/gitlabmeetings/ldr.php?RCID=44b548147a67ab4d8a62274047146415) -1. [How to Integrate Jira with GitLab](../user/project/integrations/jira.md) -1. [How to Integrate Jenkins with GitLab](../integration/jenkins.md) -1. [How to Integrate Bamboo with GitLab](../user/project/integrations/bamboo.md) -1. [How to Integrate Slack with GitLab](../user/project/integrations/slack.md) -1. [How to Integrate Convox with GitLab](https://about.gitlab.com/blog/2016/06/09/continuous-delivery-with-gitlab-and-convox/) -1. [Getting Started with GitLab and Shippable CI](https://about.gitlab.com/blog/2016/05/05/getting-started-gitlab-and-shippable/) - -<!-- vale gitlab.Spelling = YES --> - -## 4. External Articles - -1. [2011 Wall Street Journal article - Software is Eating the World](https://www.wsj.com/articles/SB10001424053111903480904576512250915629460) -1. [2014 Blog post by Chris Dixon - Software eats software development](https://cdixon.org/2014/04/13/software-eats-software-development/) -1. [2015 Venture Beat article - Actually, Open Source is Eating the World](https://venturebeat.com/2015/12/06/its-actually-open-source-software-thats-eating-the-world/) - -## 5. Resources for GitLab Team Members - -NOTE: -Some content can only be accessed by GitLab team members. - -1. [Sales Path](https://about.gitlab.com/handbook/sales/onboarding/) -1. [User Training](training/user_training.md) -1. [GitLab Flow Training](training/gitlab_flow.md) -1. [Training Topics](training/index.md) -1. [GitLab architecture](../development/architecture.md) -1. [Client Assessment of GitLab versus GitHub](https://docs.google.com/a/gitlab.com/spreadsheets/d/18cRF9Y5I6I7Z_ab6qhBEW55YpEMyU4PitZYjomVHM-M/edit?usp=sharing) +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/gitlab_flow/production_branch.png b/doc/university/training/gitlab_flow/production_branch.png Binary files differdeleted file mode 100644 index 956761d7eb8..00000000000 --- a/doc/university/training/gitlab_flow/production_branch.png +++ /dev/null diff --git a/doc/university/training/gitlab_flow/release_branches.png b/doc/university/training/gitlab_flow/release_branches.png Binary files differdeleted file mode 100644 index dcb5f97dff0..00000000000 --- a/doc/university/training/gitlab_flow/release_branches.png +++ /dev/null diff --git a/doc/university/training/index.md b/doc/university/training/index.md index f69bd51b341..02709314708 100644 --- a/doc/university/training/index.md +++ b/doc/university/training/index.md @@ -1,46 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false -type: index +redirect_to: '../../topics/index.md' --- -# GitLab Training Material +This document was moved to [another location](../../topics/index.md). -<!-- vale gitlab.Spelling = NO --> -All GitLab training material is stored in Markdown format. Slides are -generated using [Deckset](https://www.deckset.com/). -<!-- vale gitlab.Spelling = YES --> - -All training material is open to public contribution. - -This section contains the following topics: - -- [Agile and Git](topics/agile_git.md). -- [Bisect](topics/bisect.md). -- [Cherry pick](topics/cherry_picking.md). -- [Code review and collaboration with Merge Requests](topics/merge_requests.md). -- [Configure your environment](topics/env_setup.md). -- [Explore GitLab](../../gitlab-basics/index.md). -- [Feature branching](topics/feature_branching.md). -- [Getting started](topics/getting_started.md). -- [GitLab flow](gitlab_flow.md). -- [GitLab Git workshop](user_training.md). -- [Git add](topics/git_add.md). -- [Git introduction](topics/git_intro.md). -- [Git log](topics/git_log.md). -- [Git stash](topics/stash.md). -- [Merge conflicts](topics/merge_conflicts.md). -- [Rollback commits](topics/rollback_commits.md). -- [Subtree](topics/subtree.md). -- [Unstage](topics/unstage.md). - -## Additional Resources - -1. [GitLab Documentation](https://docs.gitlab.com) -1. [GUI Clients](https://git-scm.com/downloads/guis) -1. [Pro Git book](https://git-scm.com/book/en/v2) -1. <!-- vale gitlab.Spelling = NO --> [Platzi Course](https://courses.platzi.com/courses/git-gitlab/) <!-- vale gitlab.Spelling = NO --> -1. [Code School tutorial](http://try.github.io/) -1. Contact us at `subscribers@gitlab.com` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/logo.png b/doc/university/training/logo.png Binary files differdeleted file mode 100644 index c80f65c053e..00000000000 --- a/doc/university/training/logo.png +++ /dev/null diff --git a/doc/university/training/topics/agile_git.md b/doc/university/training/topics/agile_git.md index cb82d3cec64..f912f92fad2 100644 --- a/doc/university/training/topics/agile_git.md +++ b/doc/university/training/topics/agile_git.md @@ -1,33 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../user/project/issue_board.md' --- -# Agile and Git +Information about using Agile concepts in GitLab can be found in [another location](../../../user/project/issue_board.md). -## Agile - -Lean software development methods focused on collaboration and interaction -with fast and smaller deployment cycles. - -## Where Git comes in - -Git is an excellent tool for an Agile team considering that it allows -decentralized and simultaneous development. - -### Branching And Workflows - -Branching in an Agile environment usually happens around user stories with one -or more developers working on it. - -If more than one developer then another branch for each developer is also used -with their initials, and US ID. - -After its tested merge into master and remove the branch. - -## What about GitLab - -Tools like GitLab enhance collaboration by adding dialog around code mainly -through issues and merge requests. +<!-- This redirect file can be deleted after <2021-07-23>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/bisect.md b/doc/university/training/topics/bisect.md index 8af77031c93..9c06f0b407d 100644 --- a/doc/university/training/topics/bisect.md +++ b/doc/university/training/topics/bisect.md @@ -1,76 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/bisect.md' --- -# Bisect +This document was moved to [another location](../../../topics/git/bisect.md). -- Find a commit that introduced a bug -- Works through a process of elimination -- Specify a known good and bad revision to begin - -## Bisect sample workflow - -1. Start the bisect process -1. Enter the bad revision (usually latest commit) -1. Enter a known good revision (commit/branch) -1. Run code to see if bug still exists -1. Tell bisect the result -1. Repeat the previous 2 items until you find the offending commit - -## Setup - -```shell - mkdir bisect-ex - cd bisect-ex - touch index.html - git add -A - git commit -m "starting out" - vi index.html - # Add all good - git add -A - git commit -m "second commit" - vi index.html - # Add all good 2 - git add -A - git commit -m "third commit" - vi index.html -``` - -```shell - # Add all good 3 - git add -A - git commit -m "fourth commit" - vi index.html - # This looks bad - git add -A - git commit -m "fifth commit" - vi index.html - # Really bad - git add -A - git commit -m "sixth commit" - vi index.html - # again just bad - git add -A - git commit -m "seventh commit" -``` - -## Commands - -```shell - git bisect start - # Test your code - git bisect bad - git bisect next - # Say yes to the warning - # Test - git bisect good - # Test - git bisect bad - # Test - git bisect good - # done - git bisect reset -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/env_setup.md b/doc/university/training/topics/env_setup.md index bd487731783..2fd0a6762e2 100644 --- a/doc/university/training/topics/env_setup.md +++ b/doc/university/training/topics/env_setup.md @@ -1,73 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/index.md' --- -# Configure your environment +This document was removed. See our [topics](../../../topics/index.md) for similar content. -## Install - -- **Windows** - Install 'Git for Windows' from [Git for Windows](https://gitforwindows.org). -- **Mac** - - Type '`git`' in the Terminal application. - - If it's not installed, it prompts you to install it. - -- **GNU/Linux** - Enter `which git` in the Terminal application and press <kbd>Enter</kbd> to - determine if Git is installed on your system. - - - If the output of that command gives you the path to the Git executable, similar to - `/usr/bin/git`, then Git is already installed on your system. - - If the output of the command displays "command not found" error, Git isn't installed on your system. - - GitLab recommends installing Git with the default package manager of your distribution. - The following commands install Git on various GNU/Linux distributions using their - default package managers. After you run the command corresponding to your distribution - and complete the installation process, Git should be available on your system: - - - **Arch Linux and its derivatives** - `sudo pacman -S git` - - **Fedora, RHEL, and CentOS** - For the `yum` package manager run `sudo yum install git-all`, - and for the `dnf` package manager run `sudo dnf install git`. - - **Debian/Ubuntu and their derivatives** - `sudo apt-get install git` - - **Gentoo** - `sudo emerge --ask --verbose dev-vcs/git` - - **openSUSE** - `sudo zypper install git` -- **FreeBSD** - `sudo pkg install git` -- **OpenBSD** - `doas pkg_add git` - -## Configure Git - -One-time configuration of the Git client - -```shell -git config --global user.name "Your Name" -git config --global user.email you@example.com -``` - -## Configure SSH Key - -```shell -ssh-keygen -t rsa -b 4096 -C "you@computer-name" -``` - -```shell -# You will be prompted for the following information. Press enter to accept the defaults. Defaults appear in parentheses. -Generating public/private rsa key pair. -Enter file in which to save the key (/Users/you/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /Users/you/.ssh/id_rsa. -Your public key has been saved in /Users/you/.ssh/id_rsa.pub. -The key fingerprint is: -39:fc:ce:94:f4:09:13:95:64:9a:65:c1:de:05:4d:01 you@computer-name -``` - -Copy your public key and add it to your GitLab profile - -```shell -cat ~/.ssh/id_rsa.pub -``` - -```shell -ssh-rsa AAAAB3NzaC1yc2EAAAADAQEL17Ufacg8cDhlQMS5NhV8z3GHZdhCrZbl4gz you@example.com -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/feature_branching.md b/doc/university/training/topics/feature_branching.md index f6233bddb18..495462cdd00 100644 --- a/doc/university/training/topics/feature_branching.md +++ b/doc/university/training/topics/feature_branching.md @@ -1,31 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/feature_branching.md' --- -# Feature branching +This document was moved to [another location](../../../topics/git/feature_branching.md). -- Efficient parallel workflow for teams -- Develop each feature in a branch -- Keeps changes isolated -- Consider a 1-to-1 link to issues -- Push branches to the server frequently - - Hint: This is a cheap backup for your work-in-progress code - -## Feature branching sample workflow - -1. Create a new feature branch called 'squash_some_bugs' -1. Edit '`bugs.rb`' and remove all the bugs. -1. Commit -1. Push - -```shell -git checkout -b squash_some_bugs -# Edit `bugs.rb` -git status -git add bugs.rb -git commit -m 'Fix some buggy code' -git push origin squash_some_bugs -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/getting_started.md b/doc/university/training/topics/getting_started.md index 2c3d5fe15de..3dc3902c2e3 100644 --- a/doc/university/training/topics/getting_started.md +++ b/doc/university/training/topics/getting_started.md @@ -1,86 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/getting_started.md' --- -# Getting Started +This document was moved to [another location](../../../topics/git/getting_started.md). -## Instantiating Repositories - -- Create a new repository by instantiating it through: - - ```shell - git init - ``` - -- Copy an existing project by cloning the repository through: - - ```shell - git clone <url> - ``` - -## Central Repositories - -- To instantiate a central repository a `--bare` flag is required. -- Bare repositories don't allow file editing or committing changes. -- Create a bare repository with: - - ```shell - git init --bare project-name.git - ``` - -## Instantiate workflow with clone - -1. Create a project in your user namespace. - - Choose to import from **Any Repository by URL** and use <https://gitlab.com/gitlab-org/training-examples.git>. -1. Create a '`Workspace`' directory in your home directory. -1. Clone the '`training-examples`' project. - -```shell -mkdir ~/workspace -cd ~/workspace - -git clone git@gitlab.example.com:<username>/training-examples.git -cd training-examples -``` - -## Git concepts - -**Untracked files** - -New files that Git has not been told to track previously. - -**Working area** - -Files that have been modified but are not committed. - -**Staging area** - -Modified files that have been marked to go in the next commit. - -## Committing Workflow - -1. Edit '`edit_this_file.rb`' in '`training-examples`' -1. See it listed as a changed file (working area) -1. View the differences -1. Stage the file -1. Commit -1. Push the commit to the remote -1. View the Git log - -```shell -# Edit `edit_this_file.rb` -git status -git diff -git add <file> -git commit -m 'My change' -git push origin master -git log -``` - -## Note - -- `git fetch` vs `git pull` -- Pull is `git fetch` + `git merge` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/git_add.md b/doc/university/training/topics/git_add.md index d136b9151bc..aa5e756995f 100644 --- a/doc/university/training/topics/git_add.md +++ b/doc/university/training/topics/git_add.md @@ -1,40 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/git_add.md' --- -# Git Add +This document was moved to [another location](../../../topics/git/git_add.md). -Adds content to the index or staging area. - -- Adds a list of file: - - ```shell - git add <files> - ``` - -- Adds all files including deleted ones: - - ```shell - git add -A - ``` - -- Add all text files in current dir: - - ```shell - git add *.txt - ``` - -- Add all text file in the project: - - ```shell - git add "*.txt*" - ``` - -- Adds all files in directory: - - ```shell - git add views/layouts/ - ``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/git_intro.md b/doc/university/training/topics/git_intro.md index 416d421956c..2fd0a6762e2 100644 --- a/doc/university/training/topics/git_intro.md +++ b/doc/university/training/topics/git_intro.md @@ -1,27 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/index.md' --- -# Git introduction +This document was removed. See our [topics](../../../topics/index.md) for similar content. -## Intro - -<https://git-scm.com/about> - -- Distributed version control - - Does not rely on connection to a central server - - Many copies of the complete history -- Powerful branching and merging -- Adapts to nearly any workflow -- Fast, reliable and stable file format - -## Help - -Use the tools at your disposal when you get stuck. - -- Use '`git help <command>`' command -- Use Google -- Read documentation at <https://git-scm.com> +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/git_log.md b/doc/university/training/topics/git_log.md index ae4ae69ce76..1af8abb0782 100644 --- a/doc/university/training/topics/git_log.md +++ b/doc/university/training/topics/git_log.md @@ -1,60 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/git_log.md' --- -# Git Log +This document was moved to [another location](../../../topics/git/git_log.md). -Git log lists commit history. It allows searching and filtering. - -- Initiate log: - - ```shell - git log - ``` - -- Retrieve set number of records: - - ```shell - git log -n 2 - ``` - -- Search commits by author. Allows user name or a regular expression. - - ```shell - git log --author="user_name" - ``` - -- Search by comment message: - - ```shell - git log --grep="<pattern>" - ``` - -- Search by date: - - ```shell - git log --since=1.month.ago --until=3.weeks.ago - ``` - -## Git Log Workflow - -1. Change to workspace directory -1. Clone the multi runner projects -1. Change to project dir -1. Search by author -1. Search by date -1. Combine - -## Commands - -```shell -cd ~/workspace -git clone git@gitlab.com:gitlab-org/gitlab-runner.git -cd gitlab-runner -git log --author="Travis" -git log --since=1.month.ago --until=3.weeks.ago -git log --since=1.month.ago --until=1.day.ago --author="Travis" -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/merge_conflicts.md b/doc/university/training/topics/merge_conflicts.md index 66771559298..d76d297803f 100644 --- a/doc/university/training/topics/merge_conflicts.md +++ b/doc/university/training/topics/merge_conflicts.md @@ -1,69 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/merge_conflicts.md' --- -# Merge conflicts +This document was moved to [another location](../../../topics/git/merge_conflicts.md). -- Happen often -- Learning to fix conflicts is hard -- Practice makes perfect -- Force push after fixing conflicts. Be careful! - -## Merge conflicts sample workflow - -1. Checkout a new branch and edit `conflicts.rb`. Add 'Line4' and 'Line5'. -1. Commit and push. -1. Checkout master and edit `conflicts.rb`. Add 'Line6' and 'Line7' below 'Line3'. -1. Commit and push to master. -1. Create a merge request and watch it fail. -1. Rebase our new branch with master. -1. Fix conflicts on the `conflicts.rb` file. -1. Stage the file and continue rebasing. -1. Force push the changes. -1. Finally continue with the Merge Request. - -```shell -git checkout -b conflicts_branch - -# vi conflicts.rb -# Add 'Line4' and 'Line5' - -git commit -am "add line4 and line5" -git push origin conflicts_branch - -git checkout master - -# vi conflicts.rb -# Add 'Line6' and 'Line7' -git commit -am "add line6 and line7" -git push origin master -``` - -Create a merge request on the GitLab web UI, and a conflict warning displays. - -```shell -git checkout conflicts_branch -git fetch -git rebase master - -# Fix conflicts by editing the files. - -git add conflicts.rb -# No need to commit this file - -git rebase --continue - -# Remember that we have rewritten our commit history so we -# need to force push so that our remote branch is restructured -git push origin conflicts_branch -f -``` - -## Note - -- When to use `git merge` and when to use `git rebase` -- Rebase when updating your branch with master -- Merge when bringing changes from feature to master -- Reference: <https://www.atlassian.com/git/tutorials/merging-vs-rebasing> +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/merge_requests.md b/doc/university/training/topics/merge_requests.md index a4a3108ebd1..80ead103fdd 100644 --- a/doc/university/training/topics/merge_requests.md +++ b/doc/university/training/topics/merge_requests.md @@ -1,40 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../user/project/merge_requests/index.md' --- -# Code review and collaboration with Merge Requests +This document was moved to [another location](../../../user/project/merge_requests/index.md). -- When you want feedback create a merge request -- Target is the default branch (usually master) -- Assign or mention the person you would like to review -- Add `[Draft]` to the title if it's a work in progress -- When accepting, always delete the branch -- Anyone can comment, not just the assignee -- Push corrections to the same branch - -## Merge requests - -**Create your first merge request** - -1. Use the blue button in the activity feed -1. View the diff (changes) and leave a comment -1. Push a new commit to the same branch -1. Review the changes again and notice the update - -## Feedback and Collaboration - -- Merge requests are a time for feedback and collaboration -- Giving feedback is hard -- Be as kind as possible -- Receiving feedback is hard -- Be as receptive as possible -- Feedback is about the best code, not the person. You are not your code - -Review the Thoughtbot code-review guide for suggestions to follow when reviewing merge requests: -[https://github.com/thoughtbot/guides/tree/master/code-review](https://github.com/thoughtbot/guides/tree/master/code-review) - -See GitLab merge requests for examples: -[https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests) +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/rollback_commits.md b/doc/university/training/topics/rollback_commits.md index 34c2d9687bb..b87aa12b834 100644 --- a/doc/university/training/topics/rollback_commits.md +++ b/doc/university/training/topics/rollback_commits.md @@ -1,81 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/rollback_commits.md' --- -# Rollback Commits +This document was moved to [another location](../../../topics/git/rollback_commits.md). -## Undo Commits - -- Undo last commit putting everything back into the staging area: - - ```shell - git reset --soft HEAD^ - ``` - -- Add files and change message with: - - ```shell - git commit --amend -m "New Message" - ``` - -- Undo last and remove changes: - - ```shell - git reset --hard HEAD^ - ``` - -- Same as last one but for two commits back: - - ```shell - git reset --hard HEAD^^ - ``` - -**Don't reset after pushing** - -## Reset Workflow - -1. Edit file again 'edit_this_file.rb' -1. Check status -1. Add and commit with wrong message -1. Check log -1. Amend commit -1. Check log -1. Soft reset -1. Check log -1. Pull for updates -1. Push changes - -## Commands - -```shell -# Change file edit_this_file.rb -git status -git commit -am "kjkfjkg" -git log -git commit --amend -m "New comment added" -git log -git reset --soft HEAD^ -git log -git pull origin master -git push origin master -``` - -## Note - -- `git revert` vs `git reset` -- Reset removes the commit while revert removes the changes but leaves the commit -- Revert is safer considering we can revert a revert - -```shell -# Changed file -git commit -am "bug introduced" -git revert HEAD -# New commit created reverting changes -# Now we want to re apply the reverted commit -git log # take hash from the revert commit -git revert <rev commit hash> -# reverted commit is back (new commit created again) -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/stash.md b/doc/university/training/topics/stash.md index 051103e5f4b..ea9ba6a7bcc 100644 --- a/doc/university/training/topics/stash.md +++ b/doc/university/training/topics/stash.md @@ -1,82 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/stash.md' --- -# Git Stash +This document was moved to [another location](../../../topics/git/stash.md). -We use `git stash` to store our changes when they are not ready to be committed -and we need to change to a different branch. - -- Stash: - - ```shell - git stash save - # or - git stash - # or with a message - git stash save "this is a message to display on the list" - ``` - -- Apply stash to keep working on it: - - ```shell - git stash apply - # or apply a specific one from out stack - git stash apply stash@{3} - ``` - -- Every time we save a stash it gets stacked so by using `list` we can see all our - stashes. - - ```shell - git stash list - # or for more information (log methods) - git stash list --stat - ``` - -- To clean our stack we need to manually remove them: - - ```shell - # drop top stash - git stash drop - # or - git stash drop <name> - # to clear all history we can use - git stash clear - ``` - -- Apply and drop on one command: - - ```shell - git stash pop - ``` - -- If we meet conflicts we need to either reset or commit our changes. -- Conflicts through `pop` doesn't drop a stash afterwards. - -## Git Stash sample workflow - -1. Modify a file -1. Stage file -1. Stash it -1. View our stash list -1. Confirm no pending changes through status -1. Apply with pop -1. View list to confirm changes - -```shell -# Modify edit_this_file.rb file -git add . - -git stash save "Saving changes from edit this file" - -git stash list -git status - -git stash pop -git stash list -git status -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/subtree.md b/doc/university/training/topics/subtree.md index 54461915a05..5090ff8ca36 100644 --- a/doc/university/training/topics/subtree.md +++ b/doc/university/training/topics/subtree.md @@ -1,52 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/subtree.md' --- -# Subtree +This document was moved to [another location](../../../topics/git/subtree.md). -- Used when there are nested repositories. -- Not recommended when the amount of dependencies is too large. -- For these cases we need a dependency control system. -- Command are painfully long so aliases are necessary. - -## Subtree Aliases - -- Add: `git subtree add --prefix <target-folder> <url> <branch> --squash` -- Pull: `git subtree pull --prefix <target-folder> <url> <branch> --squash` -- Push: `git subtree add --prefix <target-folder> <url> <branch>` -- Ex: `git config alias.sbp 'subtree pull --prefix st / - git@gitlab.com:balameb/subtree-nested-example.git master --squash'` - -```shell - # Add an alias - # Add - git config alias.sba 'subtree add --prefix st / - git@gitlab.com:balameb/subtree-nested-example.git master --squash' - # Pull - git config alias.sbpl 'subtree pull --prefix st / - git@gitlab.com:balameb/subtree-nested-example.git master --squash' - # Push - git config alias.sbph 'subtree push --prefix st / - git@gitlab.com:balameb/subtree-nested-example.git master' - - # Adding this subtree adds a st dir with a readme - git sba - vi st/README.md - # Edit file - git status shows differences - -``` - -```shell - # Adding, or committing won't change the sub repo at remote - # even if we push - git add -A - git commit -m "Adding to subtree readme" - - # Push to subtree repo - git sbph - # now we can check our remote sub repo -``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/topics/unstage.md b/doc/university/training/topics/unstage.md index 30d26854135..13c21f5cbb2 100644 --- a/doc/university/training/topics/unstage.md +++ b/doc/university/training/topics/unstage.md @@ -1,33 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false +redirect_to: '../../../topics/git/unstage.md' --- -# Unstage +This document was moved to [another location](../../../topics/git/unstage.md). -- To remove files from stage use reset HEAD where HEAD is the last commit of the current branch. This unstages the file but maintain the modifications. - - ```shell - git reset HEAD <file> - ``` - -- To revert the file back to the state it was in before the changes we can use: - - ```shell - git checkout -- <file> - ``` - -- To remove a file from disk and repository, use `git rm`. To remove a directory, use the `-r` flag: - - ```shell - git rm '*.txt' - git rm -r <dirname> - ``` - -- If we want to remove a file from the repository but keep it on disk, say we forgot to add it to our `.gitignore` file then use `--cache`: - - ```shell - git rm <filename> --cache - ``` +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> diff --git a/doc/university/training/user_training.md b/doc/university/training/user_training.md index e9cca233d6f..fa870b151b2 100644 --- a/doc/university/training/user_training.md +++ b/doc/university/training/user_training.md @@ -1,346 +1,8 @@ --- -stage: none -group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments -comments: false -type: reference +redirect_to: '../../topics/index.md' --- -# GitLab Git Workshop +This document was removed. See our [topics](../../topics/index.md) for similar content. -## Agenda - -1. Brief history of Git. -1. GitLab walkthrough. -1. Configure your environment. -1. Workshop. - -## Git introduction - -<https://git-scm.com/about> - -- Distributed version control. - - Does not rely on connection to a central server. - - Many copies of the complete history. -- Powerful branching and merging. -- Adapts to nearly any workflow. -- Fast, reliable and stable file format. - -## Help - -Use the tools at your disposal when you get stuck. - -- Use '`git help <command>`' command. -- Use Google. -- Read documentation at <https://git-scm.com>. - -## GitLab Walkthrough - -![fit](logo.png) - -## Configure your environment - -- Windows: Install 'Git for Windows' - -> <https://gitforwindows.org> - -- Mac: Type '`git`' in the Terminal application. - -> If it's not installed, it prompts you to install it. - -- Debian: '`sudo apt-get install git-all`' or Red Hat '`sudo yum install git-all`' - -## Git Workshop - -### Overview - -1. Configure Git. -1. Configure SSH Key. -1. Create a project. -1. Committing. -1. Feature branching. -1. Merge requests. -1. Feedback and Collaboration. - -## Configure Git - -One-time configuration of the Git client: - -```shell -git config --global user.name "Your Name" -git config --global user.email you@example.com -``` - -## Configure SSH Key - -```shell -ssh-keygen -t rsa -b 4096 -C "you@computer-name" -``` - -```shell -# You will be prompted for the following information. Press enter to accept the defaults. Defaults appear in parentheses. -Generating public/private rsa key pair. -Enter file in which to save the key (/Users/you/.ssh/id_rsa): -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /Users/you/.ssh/id_rsa. -Your public key has been saved in /Users/you/.ssh/id_rsa.pub. -The key fingerprint is: -39:fc:ce:94:f4:09:13:95:64:9a:65:c1:de:05:4d:01 you@computer-name -``` - -Copy your public key and add it to your GitLab profile: - -```shell -cat ~/.ssh/id_rsa.pub -``` - -```shell -ssh-rsa AAAAB3NzaC1yc2EAAAADAQEL17Ufacg8cDhlQMS5NhV8z3GHZdhCrZbl4gz you@example.com -``` - -## Create a project - -- Create a project in your user namespace. - - Choose to import from **Any Repository by URL** and use <https://gitlab.com/gitlab-org/training-examples.git>. -- Create a '`development`' or '`workspace`' directory in your home directory. -- Clone the '`training-examples`' project. - -## Commands (project) - -```shell -mkdir ~/development -cd ~/development - --or- - -mkdir ~/workspace -cd ~/workspace - -git clone git@gitlab.example.com:<username>/training-examples.git -cd training-examples -``` - -## Git concepts - -### Untracked files - -New files that Git has not been told to track previously. - -### Working area - -Files that have been modified but are not committed. - -### Staging area - -Modified files that have been marked to go in the next commit. - -## Committing - -1. Edit '`edit_this_file.rb`' in '`training-examples`'. -1. See it listed as a changed file (working area). -1. View the differences. -1. Stage the file. -1. Commit. -1. Push the commit to the remote. -1. View the Git log. - -## Commands (committing) - -```shell -# Edit `edit_this_file.rb` -git status -git diff -git add <file> -git commit -m 'My change' -git push origin master -git log -``` - -## Feature branching - -- Efficient parallel workflow for teams. -- Develop each feature in a branch. -- Keeps changes isolated. -- Consider a 1-to-1 link to issues. -- Push branches to the server frequently. - - Hint: This is a cheap backup for your work-in-progress code. - -## Feature branching steps - -1. Create a new feature branch called 'squash_some_bugs'. -1. Edit '`bugs.rb`' and remove all the bugs. -1. Commit. -1. Push. - -## Commands (feature branching) - -```shell -git checkout -b squash_some_bugs -# Edit `bugs.rb` -git status -git add bugs.rb -git commit -m 'Fix some buggy code' -git push origin squash_some_bugs -``` - -## Merge requests - -- When you want feedback create a merge request. -- Target is the 'default' branch (usually master). -- Assign or mention the person you would like to review. -- Add `[Draft]` to the title if it's a work in progress. -- When accepting, always delete the branch. -- Anyone can comment, not just the assignee. -- Push corrections to the same branch. - -## Merge requests steps - -Create your first merge request: - -1. Use the blue button in the activity feed. -1. View the diff (changes) and leave a comment. -1. Push a new commit to the same branch. -1. Review the changes again and notice the update. - -## Feedback and Collaboration - -- Merge requests are a time for feedback and collaboration. -- Giving feedback is hard. -- Be as kind as possible. -- Receiving feedback is hard. -- Be as receptive as possible. -- Feedback is about the best code, not the person. You are not your code. - -## Feedback and Collaboration resources - -<!-- vale gitlab.Spelling = NO --> - -Review the Thoughtbot code-review guide for suggestions to follow when reviewing merge requests: -<https://github.com/thoughtbot/guides/tree/master/code-review>. - -<!-- vale gitlab.Spelling = YES --> - -See GitLab merge requests for examples: <https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests>. - -## Explore GitLab projects - -![fit](logo.png) - -- Dashboard -- User Preferences -- README, Changelog, License shortcuts -- Issues -- Milestones and Labels -- Manage project members -- Project settings - -## Tags - -- Useful for marking deployments and releases. -- Annotated tags are an unchangeable part of Git history. -- Soft/lightweight tags can be set and removed at any time. -- Many projects combine an annotated release tag with a stable branch. -- Consider setting deployment/release tags automatically. - -## Tags steps - -1. Create a lightweight tag. -1. Create an annotated tag. -1. Push the tags to the remote repository. - -Additional resources: <https://git-scm.com/book/en/v2/Git-Basics-Tagging>. - -## Commands (tags) - -```shell -git checkout master - -# Lightweight tag -git tag my_lightweight_tag - -# Annotated tag -git tag -a v1.0 -m 'Version 1.0' -git tag - -git push origin --tags -``` - -## Merge conflicts - -- Happen often. -- Learning to fix conflicts is hard. -- Practice makes perfect. -- Force push after fixing conflicts. Be careful! - -## Merge conflicts steps - -1. Checkout a new branch and edit `conflicts.rb`. Add 'Line4' and 'Line5'. -1. Commit and push. -1. Checkout master and edit `conflicts.rb`. Add 'Line6' and 'Line7' below 'Line3'. -1. Commit and push to master. -1. Create a merge request. - -## Merge conflicts commands - -After creating a merge request you should notice that conflicts exist. Resolve -the conflicts locally by rebasing. - -```shell -git rebase master - -# Fix conflicts by editing the files. - -git add conflicts.rb -git commit -m 'Fix conflicts' -git rebase --continue -git push origin <branch> -f -``` - -## Rebase with squash - -You may end up with a commit log that looks like this: - -```plaintext -Fix issue #13 -Test -Fix -Fix again -Test -Test again -Does this work? -``` - -Squash these in to meaningful commits using an interactive rebase. - -## Rebase with squash commands - -Squash the commits on the same branch we used for the merge conflicts step. - -```shell -git rebase -i master -``` - -In the editor, leave the first commit as `pick` and set others to `fixup`. - -## Questions? - -![fit](logo.png) - -Thank you for your hard work! - -## Additional Resources - -See [additional resources](index.md#additional-resources). - -<!-- ## Troubleshooting - -Include any troubleshooting steps that you can foresee. If you know beforehand what issues -one might have when setting this up, or when something is changed, or on upgrading, it's -important to describe those, too. Think of things that may go wrong and include them here. -This is important to minimize requests for support, and to avoid doc comments with -questions that you know someone might ask. - -Each scenario can be a third-level heading, e.g. `### Getting error message X`. -If you have none to add when creating a doc, leave this section in place -but commented out to help encourage others to add to it in the future. --> +<!-- This redirect file can be deleted after <2021-08-13>. --> +<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/#move-or-rename-a-page --> |