Organizational stuff
Jakub Gutkowski
Enjoying Life
@gutek
https://blog.gutek.pl
Familiarize yourself with GitHub, GitHub features and GitHub flow
link in chat
Created in 2005 by Linus Torvalds
For developing of Linux kernel
Distributed Version Control System
(open sourced) with collaborative and remote work in the heart
Centralized
Distributed
SHA-1
49e68ee44ba1c8bc093c5523635ddba5c4e6a55e
most VCS
git
Most VCS
Git
git config --global user.name "John Doe"
git config --global user.email john@doe.com
# set default branch name to main
git config --global init.defaultBranch main
# optionally, change default editor:
git config --global core.editor "code --wait"
git config --global core.editor "nano"
git config --global core.editor "vim"
# create reposiotry
git init
# list folders
ls -la
# create file and add it
echo "THIS IS TEST" > README.md
git add README.md
# commit changes to current branch
git commit -m "add readme file"
git init
ls -la
echo "THIS IS TEST" > README.md
git status
git add README.md
git status
git commit -m "add readme file"
git status
echo "NEW CONTENT" > README.md
git status
git add .
git status
git commit -m "replacing file"
A collaboration platform that uses git as a source for managing assets.
It happens to be mainly used by developers to create and collaborate on software projects, but it does not need to be.
None, two different products. It just happens that underneath nice UI and feature reach platform of GitHub, as a foundation, lays git, distributed version control system fuse some of the most advanced features of GitHub
Developers/DevOps (the one that wants to be, junior, senior, past developers, etc) and then Organisations (with many developers ;))
basically anyone who wants to work with code
Yes
Currently is used by 65+ million developers with an aim to reach 100 million in 2025
It hosts more than 200 million repositories and is used by over 3 million organisations including 72% of Fortune 50
Since 2018, GitHub is part of Microsoft
All Microsoft open source projects are hosted on GitHub
More than 2000 Google employees contribute to projects on Github
More than 2000 RedHat employees contribute to projects on GitHub
More than 1000 employees of IBM and Intel contributes to projects on GitHub
Almost every big company contributes or hosts projects on GitHub
So why don't you? :)
Code
Issues
Pull Requests
Automation
Discussions
REPOSITORIES
# open https://github.com/microsoft/muzic
# Code >
# - Open with GitHub Desktop
# - Open with Visual Studio
# - Download ZIP
# - Clone - https/ssh
git clone https://github.com/microsoft/muzic.git
git clone git@github.com:microsoft/muzic.git
Only do it if you do not have an account!
ssh-keygen -t ed25519 -C "github.email@address.com"
# ssh-keygen -t rsa -b 4096 -C "github.email@address.com"
# start ssh agent
eval "$(ssh-agent -s)"
# add key to ssh agent
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub
# copy and paste it to GitHub
# test if you can log in
ssh -T git@github.com
REPOSITORIES
echo "# empty" >> README.md
git init
git add README.md
git commit -m "first commit"
# move branch/rename
git branch -M main
git remote add origin https://github.com/Gutek/NAME.git
git push -u origin main
# or
git remote add origin https://github.com/Gutek/NAME.git
git branch -M main
git push -u origin main
It's a collaborative space where the community can discuss around project and or initiative
It fills the gap that Issues had created - where to discuss proposition, ask questions, share ideas
Issues have different contexts and meanings, mixing it adds cognitive load to daily work
Tags
Releases
Releases use tags to mark specific points of time, for which release is created
In GitHub, releases are extensions of tags
We can create them only on GitHub
We need to specify a tag, that specifies the point in time of the repository
From command line git tag
When creating new release in GitHub
# create simple tag of current commit
git tag TAG_NAME
# get commit id
git log
# creates tag for specific commit
git tag NEW_TAG b66c75ba
# creates commit with annotiations (dates etc)
git tag -a A_TAG -m "message"
# to push tags to GitHub
git push --tags
# create branch from current branch/commit
# and change to this new branch
git checkout -b BRANCH_NAME
# same as above, but slower
git branch BRANCH_NAME
git checkout BRANCH_NAME
# list local branches
git branch
# list all branches, including remote (that we know of)
git branch -a
# delete branch
git branch -d BRANCH_NAME
# merge/rebase branch to current branch
git merge SOURCE_BRANCH
git rebase SOURCE_BRANCH
If CODEOWNERS file exists, Pull Request will automatically be assigned to people who are owners of specific files/paths defined in CODEOWNERS
How cool is that?
From now on we will be using an application from the repository:
To guarantee that code and all dependencies including references lib's, docker images, etc. are vulnerability free
sercurity
quality
name: "Security and Quality"
queries:
- uses: security-and-quality
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml # <-- add this line
From now on we will be using an application from the repository:
Actions is a piece of code executing a specific task. Actions are used in Workflow. Workflows define jobs and steps that we can automatically execute depending on the trigger (push, pull request created etc)
We define workflows in yaml format and we store it in our repo
We have control of what we want to execute and in what order
From now on we will be using an application from the repository:
Jakub Gutkowski
Enjoying Life
@gutek
https://blog.gutek.pl