Git and GitHub
Contents
Git and GitHub#
Basic knowledge of Git and GitHub is essential for the course. Although we expect some working knowledge of those, it is good to refresh some basics or review some best practices before the class.
We expect you to fork the repository periodically to experiment with the code during the course. You will also implement your end2end ML project that should be hosted on GitHub, so you will have a way to version and share your code with us.
Git#
Git is a free and open-source distributed version control system designed to handle projects with speed and efficiency. It is the most widely used modern version control system in the world today.
To start using Git on your system, we recommend the following guides based on your platform:
Basic commands#
Command |
Description |
---|---|
|
clone repository into local file system |
|
check current branch, changes and overall repo status |
|
list all commits on local active branch (can differ from origin branch when changes are not pulled) |
|
update local branch by |
Branch commands#
Command |
Description |
---|---|
|
list all repo branches (active one is highlighted) |
|
switch into branch |
|
create branch and switch into new created branch |
|
delete branch |
|
delete unused remote branches from local machine |
Branch naming conventions#
prefix/name-in-lowercase-kebab-case
prefix options:
feat/
- feature developmentfix/
- bug fixrefactor/
- refactoringdocs/
- documentationtest/
- testschore/
- grunt tasks (no production code change)style/
- code style change
Commit commands#
Command |
Description |
---|---|
|
add all changed files into commit |
|
add changed file into commit |
|
create commit with message |
|
create commit with message and body |
|
push commit into branch on public git server |
|
add current commit to previous commit (default editor pops up and commit message can be changed) |
|
force push commit into branch on public git server (aplicable when using |
|
use when fixing commit during code review |
Commit message conventions#
type(optional scope): write short message in lower case and imperative
type options are the same as branch prefix options
GitHub#
GitHub is a cloud-based hosting service that lets you manage Git repositories.
To get started working with Git, we recommend reviewing the following:
Hello World exercise to create a repository (for more detail, visit the link), create a branch (can be handled with Git as well), and contribute to a repository.
Fork a repo guide to learn how to copy a repository to experiment with it. This is the preferred way of getting a copy of the course exercises.
Once you fork a repo, you might want to keep it synced with the upstream repository . This is recommended way to keep your course copy up to date.
For additional information visit [Gita].
Resources#
- Atl
Atlassian. Learn git with bitbucket cloud: atlassian git tutorial. URL: https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud.
- Gita
GitHub. Get started with github. URL: https://docs.github.com/en/get-started.
- Gitb
GitHub. Github: git cheat sheet. URL: https://education.github.com/git-cheat-sheet-education.pdf.