# GIT grundkurs

Nivå: beginner | Målgrupp: Programutvecklare | Förkunskaper: Erfarenhet av programmering i något språk
https://www.ribomation.se/programmerings-kurser/git/

Den här kursen ger omfattande kunskaper i GIT och hur du använder det för att arbeta effektivt i både små och stora
programutvecklingsteam. Du får också lära dig att arbeta effektivt mot GIT fjärrservrar, samt kunna ta dig ur olika
misstag.

GIT är det helt dominerande versionshanteringssystemet för programkod, på grund av att det underlättar för team att
arbeta isolerat med delar av koden utan att störa arbetet med andra delar av koden. När det sen är dags att infoga
resultatet gör GIT det mesta av editeringsarbetet via en merge eller rebase operation.

Den här kursen ger omfattande kunskaper i GIT och hur du använder det för att arbeta effektivt i både små och stora
programutvecklingsteam. Du får också lära dig att arbeta effektivt mot GIT fjärrservrar, samt kunna ta dig ur olika
misstag.

- Be able to use BASH effectively
- Be able to write shell scripts to perform routine tasks and configure servers
- Be able to create pipelines of commands

#### Background and Overview
- History
- Properties
- How GIT differs from most other version control systems

#### Basic Operations
- Installation and configuration of a GIT client
- Creating a local GIT project
- Rudimentary configuration
- Viewing help info
- Staging files
- Checking the project status
- Commiting files

#### Working with Commits
- What is a commit
- Understanding HEAD
- Blobs and trees
- Understand the commit ID, i.e. SHA-1 hash
- The organization of the .git/ directory
- Commit messages
- How to pass multi-line commit messages on the command-line from other sources
- Quick commits
- Interactive add
- Viewing the commit history
- Tagging
- Simple vs. annotated tags
- How to view a file for a specific revision
- How to find out what has changed in a file
- How to find how much has changed in a commit
- How to find out who made a change

#### Configuration
- Setting and reading configuration properties
- Local and global properties
- How to exclude generated files, such as `*.class, *.o, *~`
- How to let GIT identify text files and separate out binary files
- How to prevent GIT from removing empty directories
- How to define your own GIT shortcuts
- Creating your own GIT macros with GIT aliases

#### Branching
- What is a branch
- Creating a branch
- Switching to branches
- Listing branches
- Renaming branches
- Deleting branches
- What is *detached HEAD*

#### Merging
- What is a merge operation
- Pre-merge scenarios
- Fast-forwarding merge
- True merge
- Non-conflicting and conflicting merge operations
- Initiating a merge
- Aborting a merge
- Resolving merge conflicts

#### GIT Flow
- Branch categories
- Development branches
- Understanding GIT Flow
- GIT Flow shell extensions
- GIT Flow steps and operations

#### Rebasing
- What is a rebase operation and how do it differs from a merge operation
- Performing a rebase operation, step-by-step
- Aligning branches
- Interactive rebase
- Editing commit messages
- Squashing commits
- Reorder commits
- Skipping commits

#### Using GitLab
- Setting up a GitLab account
- Creating a GitLab project
- Rudimentary configuration

#### Starting a Remote GIT Project
- What is a remote GIT repository
- SSH vs. HTTPS
- Generating SSH keys and register them with a server such as GitLab
- Cloning an existing repo
- Create a new repo and clone it
- Attach a local repo to a newly created remote repo
- Creating a bare repo and clone it locally

#### Working with Remote Repos
- Adding and removing associations to remote repos
- Understanding tracking of remote branches
- Uploading commits (push)
- Downloading commits (fetch)
- Understanding what happens during a fetch operation
- Merging a remote branch with a local branch
- Using pull

#### Collaboration between Remote Repos
- What is a fork operation
- What is a merge request, aka pull request
- Contributing code to a non-authorized repo
- Submitting a merge/pull request

#### Recovering from Mistakes
- Undo code changes
- Undo add
- Undo last commit
- Undo push
- Undo merge
- Undo rebase
- Undo merge commit
- Reset a project to specified commit point
- Fixing a commit to the wrong branch
- Preventing GIT from removing empty dirs
- Creating a source archive file, without its GIT history

#### Stashing
- What is GIT stashing
- Pushing to the stash stack
- Inspecting the stash stack
- Popping from the stash stack

#### GIT Hooks
- What is a GIT hook
- Hookable GIT events
- How to print a message before commit
- Preventing unwanted commit messages

#### Searching the Commit History
- Understanding the log command
- What is GIT bisect
- Bisect initialization
- Bisect bug hunting
- Finishing an active bisect operation
- Scripting bisect bug hunting

#### GIT Tools
- Graphical GIT clients
- Running you own GIT server
- Using the GitHub Desktop
- Show diffs and perform merge operations with Meld and Diffuse
- Incremental merge with `git-imerge`
- Running your own server in seconds with GitBlit
- Running your own full-scale server with GitLab
