0% found this document useful (0 votes)
30 views58 pages

Git Intermediate Workshop

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views58 pages

Git Intermediate Workshop

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Git

Workshop
Slides:
https://goo.gl/kE65m3
What do we need for start this workshop?
Git Installation and Setup

GitHub Account

Go Hugo Installation

Use the Command Line

Text Editor
Git Installation
Go to https://git-scm.com/downloads and
choose your SO.
Github Account
https://github.com/
Agenda
1.- Getting Started with Git

2.- Git Fundamentals

3.- Git Branching

4.- Working Remotely

5.- Workflows

6.- Exploring Git


Introduction
What is Git and what is Github?

isn’t
Git as Software

Created by Directed Distributed


File System
Linus Torvalds Acyclic Graph Version Control
GitHub as Platform

Is a Platform Software
Collaborative
for developers Development
Software
Projects Manage using
Git
Git History
https://www.youtube.com/watch?v=jHzbLNVhv-c

Linux Kernel
https://www.youtube.com/watch?v=5iFnzr73XXk&t=4686s

Python
https://www.youtube.com/watch?v=cNBtDstOTmA&t=23s
Tools ?
My Tools
Getting Started With Git
Getting Started with Git
1. Installation and setup
2. Basic command line usage
3. Setting up a new repository
4. Adding a file
5. Commit the added file
6. Modify a committed file
Git Setup
Add your username and email

git config --global user.name “My Name“

git config --global user.email "[email protected]"

Check your username and email

git config --global user.name

git config --global user.email


Command Line
Unix/Linux:

ls, mkdir, pwd, cd

Windows:

dir, mkdir, chdir, cd


Setting up a new repository

$ mkdir my-git-practice

$ cd my-git-practice

$ git init
Adding and commit a file

Create a file called readme.md and add to the version


control
Adding a File
$ touch readme.md

$ git status <- whats happen?

$ git add readme.md

$ git status <- whats happen?


Commit the added file

$ git commit -m “ description ”

$ git status <- whats happen?

$ git log
Commit History

$ git log

$ gitk
Adding and commit a file: git commands

$ git add file

$ git commit -m “Description”


Modify the committed file

… edit the readme.md

$ git status <- whats happen?

$ git diff readme.md


Delete changes

$ git checkout -- readme.md


Git Fundamentals
Git Fundamentals
1. File Status life cycle
2. The working directory
3. The staging area
4. The local repository
File Status Life Cycle

WORKING LOCAL REMOTE


STAGE AREA REPOSITORY REPOSITORY
DIRECTORY
File Status Life Cycle
Working Remotely
Working Remotely
1. Setting up a Github Account
2. Add Origin repository
3. Cloning a repository
4. Uploading to remote repository
5. Downloading remote changes
Github Pages

https://raw.githubusercontent.com/GitGrou
pStudyMx/Git-Practice/master/index.html
Add origin repository

$ git remote add origin url-to-github


Clone an exists repository

$ git clone url-to-github


Download and publish changes to remote
repository

$ git push origin branch-name

$ git pull origin branch-name


Git Branching
Git Branching
1. Create a new branch
2. Switching from branch to branch
3. Merging Branches
4. Merge conflicts
5. Stashing
Create a new branch

$ git checkout -b my-new-branch

$ git branch
Switching branches

$ git checkout branch


Merging Branches

In your current branch

$ git merge branch-to-merge


Git Branching

my-other-branch

$ git merge branch-name


master branch
Git Branching
carlogilmar

$ git merge branch-name


master branch

luissas

onahump
Stashing

$ git stash

$ git stash list

$ git stash pop


Workflows
Workflows
1. Centralized workflows
2. Feature branch workflow
Centralized Workflows
Feature branch Workflow
Exploring Git
Exploring Git
1. Github Repositories
2. Github Pages
3. Pull Request
4. Creating an static web site
Installation

GoHugo
https://gohugo.io
MKDocs
https://www.mkdocs.org
Github Pages

https://raw.githubusercontent.com/GitGrou
pStudyMx/Git-Practice/master/index.html
Go Hugo

$ hugo serve
$ hugo new site quickstart
$hugo -D
MKDocs
mkdocs new [dir-name] - Create a new project.
mkdocs serve - Start the live-reloading docs server.
mkdocs build - Build the documentation site.
mkdocs help - Print this help message.
Exercise

GoHugo / MKDocs
Repository Site Repository
https://education.github.com/pack
Thanks!

You might also like