Git and GitLab: Version Control, Installation, Configuration and Usage

introduction to git and gitlab cs330e elements n.w
1 / 16
Embed
Share

Discover the essentials of version control using Git and GitLab, from understanding their definitions to learning about installation, configuration, and usage. Dive into the world of collaborative software development with this comprehensive guide.

  • Git
  • GitLab
  • Version Control
  • Software Development
  • Collaboration

Uploaded on | 3 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Introduction to Git and GitLab CS330E Elements of Software Engineering I Dr. Fares Fraij

  2. On-line resources Git website: http://git-scm.com/ Git Book: http://git-scm.com/book/ GitLab: https://gitlab.com/ GitLab basics: https://docs.gitlab.com/ee/gitlab-basics/

  3. Outline What is version control? What is Git? How does Git work? How to install Git? How to configure Git? What is GitLab? How to create an account on GitLab? Branch Merge Request

  4. What is version control? Definition: Version control is a system that records changes to files over time so that you can recall specific versions later. Purpose: It helps track and manage changes to code, documents, and other files, facilitating collaboration and recovery from errors.

  5. What is Git? Definition: Git is a distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

  6. How Does Git Work? Local Repository: Stores the full history of changes on your local machine. Staging Area: Holds changes that are about to be committed. Commit: Records changes to the local repository. Branching and Merging: Allows for parallel development and integration of different features or fixes. Remote Repository: A version of the project hosted on a server (e.g., GitLab) where team members can push and pull changes.

  7. How to install Git? On Windows: Download the installer from Git's official website. Run the installer and follow the prompts. Choose default options or customize as needed. On Mac OS: Install via Homebrew: brew install git Alternatively, download the installer from Git's official website and follow the instructions.

  8. How to Configure Git? In your shell, type in the following commands to configure git: $ git config --global user.name "John Galt" $ git config --global user.email jgalt@example.com $ git config --global push.default simple $ git config --global color.ui true If you're using OS X or Linux: $ git config --global core.autocrlf input If you're using Windows: $ git config --global core.autocrlf true

  9. What is GitLab? Definition: GitLab is a web-based DevOps lifecycle tool that provides a Git repository manager with features such as issue tracking, CI/CD pipelines, and project management. Key Features: Integrated CI/CD Issue tracking and project management Code review and collaboration Monitoring and security features

  10. How to create an account on GitLab? 1. Go to GitLab s website. 2. Click on "Register" or "Sign up". 3. Enter your details (do NOT sign up using your Google or GitHub account). 4. Verify your email address to complete the registration.

  11. Branch What is a Branch? A branch in Git is a separate line of development in a repository. It allows you to work on features, bug fixes, or experiments independently from the main branch or other branches. Purpose of Branches: Isolation: Develop features or fixes without affecting the main codebase. Parallel Development: Enable multiple developers to work on different tasks simultaneously. Experimentation: Try new ideas safely without impacting the stable code.

  12. Branch Common Commands: Create a Branch: git branch <branch_name> Switch to a Branch: git checkout <branch_name> or git switch <branch_name> List Branches: git branch Delete a Branch: git branch -d <branch_name> (safe delete) or git branch -D <branch_name> (force delete) Example Workflow: Create a new branch for a feature: git checkout -b feature_branch Make changes and commit them. Switch back to main: git checkout main Merge the feature branch into main: git merge feature_branch

  13. Merge Request What is a Merge Request? A merge request (MR) is a request to merge changes from one branch into another, typically from a feature branch into the main branch. It allows for code review and discussion before integration. Purpose of Merge Requests: Code Review: Ensure code quality and consistency through peer review. Collaboration: Discuss and address feedback or concerns before merging. Integration: Combine changes into the main codebase in a controlled manner.

  14. Merge Request Steps to Create a Merge Request: Push Your Branch: Push your feature branch to GitLab: git push origin feature_branch 1. Open Merge Request: 2. Go to the GitLab project. Navigate to Merge Requests and click New merge request. Select the source branch (feature_branch) and target branch (main). Add a title, description, and any relevant details. Submit the merge request.

  15. Merge Request Example Workflow: Create and push a branch for new features. Open a merge request to merge the feature branch into main. Review, discuss, and finalize the merge request. Merge the request once approved.

  16. References References 1. Git Official Website: https://git-scm.com 1. Provides downloads, documentation, and resources for Git. 2. GitLab Official Website: https://gitlab.com 1. Offers information on GitLab features, account creation, and documentation. 3. Git Documentation: https://git-scm.com/doc 1. Comprehensive resource for Git commands, configuration, and best practices. 4. GitLab Documentation: https://docs.gitlab.com 1. Detailed guides on using GitLab, from basic operations to advanced features. 5. Homebrew: https://brew.sh 1. A package manager for macOS used to install Git on Mac systems. 6. Git Configuration Guide: https://git-scm.com/book/en/v2/Customizing-Git-Git- Configuration 1. A detailed guide on configuring Git settings.

More Related Content