SlideShare a Scribd company logo
(origin)MasteringGIT
git init
Iván Palma | ipalma@mobaires.com
Index
● Git Basics
● Useful when collaborating
● More advanced stuff
Gitbasics
Basics and prerequisites to follow this guide:
● Try Git: https://try.github.io/
● Git The Three States: https://git-scm.com/book/en/v2/Getting-Started-Git-
Basics#The-Three-States
a. Committed (data in the repo)
b. Modified (file changed but not committed)
c. Staged (marked a modified file to go
into your next commit)
● Understanding Git Conceptually:
http://www.sbf5.com/~cduan/technical/git/
a. Repositories
b. Branching
c. Merging
d. Collaborating
e. Rebasing
USefulwhencollaborating
1. Fork
2. Pull Requests
3. Remotes
4. Merge vs Rebase
1. fork
A fork is a copy of a repository, that allows you to freely experiment without
affecting the original project.
Usual workflow:
● Fork the repository.
● Make the fix.
● Submit a pull request to the project owner.
More info: https://help.github.com/articles/fork-a-repo/
2.pullrequests
Pull requests let you tell others about changes you've pushed to a repository
on GitHub. A pull request let pull your fix from your fork into the original
repository.
It allows:
● Review proposed changes
● Discuss changes
● Merge changes
More info: https://help.github.com/articles/using-pull-requests/
3.Remotes
Remote repositories are versions of your project that are hosted on the
network. Collaborating with others involves managing these remote
repositories.
Useful commands:
● Show remotes: git remote -v
● Add remote: git remote add [shortname] [url]
● Rename remote: git remote rename [shortname] [newname]
● Remove remote: git remote rm [shortname]
More info: https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
4.mergevsRebase
Both of these commands are designed to integrate changes from one branch into
another branch—they just do it in very different ways.
It’s easier to see what both commands do with the following example:
1. Start working on a new feature in
a dedicated branch.
2. A team member updates the master
branch with new commits.
3. To incorporate the new commits
into your feature branch, you
have two options: merging or
rebasing.
4.mergevsRebase
The Merge Option:
git checkout feature
git merge master
or
git merge master feature
This creates a new “merge commit” in
the feature branch.
Merging:
● It’s a non-destructive operation (the existing branches are not changed).
● The feature branch will have an extraneous merge commit every time you
need to incorporate upstream changes.
4.mergevsRebase
The Rebase Option:
git checkout feature
git rebase master
This moves the feature branch to
begin on the tip of the master
branch.
Rebasing:
● Cleaner project history (new commit for each commit in the original branch).
● Results in a perfectly linear project history.
4.mergevsRebase
Important things for Rebase
● The Golden Rule of Rebasing: never use it on public branches.
● Force-Pushing: git push --force. This overwrites the remote master branch
to match the rebased one from your repository.
More info:
https://www.atlassian.com/git/tutorials/merging-vs-rebasing
https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase/
Moreadvancedstuff
1. Reset
2. Checkout
3. Revert
4. Reflog
5. Log
6. Stash
7. Other commands
8. Git Autocomplete
1. reset
On the commit-level, moves the tip of a branch to a different commit.
Example: git reset HEAD~2
1. reset
Flags: --soft, --mixed and --hard. Examples:
git reset --mixed HEAD
Unstage all changes, but leaves
them in the working directory
git reset --hard HEAD
Completely throw away all your
uncommitted changes
2.checkout
Most common usage: switch between branches: git checkout hotfix .
You can also check out arbitrary commits: git checkout HEAD~2 . However, since
there is no branch reference to the current HEAD, this puts you in a detached
HEAD state.
3.revert
Undoes a commit by creating a new commit. This is a safe way to undo changes.
Example: git revert HEAD~2
summary:Reset-Checkout-Revert
Command Scope Common use cases
git reset Commit-level Discard commits in a private branch or
throw away uncommited changes
git reset File-level Unstage a file
git checkout Commit-level Switch between branches or inspect old
snapshots
git checkout File-level Discard changes in the working directory
git revert Commit-level Undo commits in a public branch
git revert File-level (N/A)
More info: https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting
4.reflog
It records almost every change you make in your repository.
You can think of it is a chronological history of everything you’ve done in
your local repo.
Example: you can use this to revert to a state that would otherwise be lost,
like restoring some lost commits.
git reflog
5.Log
Shows the commit logs.
There are some useful flags that let you format or filter the output:
● --oneline
● --decorate (display all of the references)
● --graph
● --max-count=
● --author=<pattern>
● --grep=<pattern>
More info: http://git-scm.com/docs/git-log
6.stash
Let you pause what you’re currently working on and come back to it later.
Useful stash commands:
● git stash / git stash save <message>
● git stash apply / git stash pop
● git stash list
● git stash drop <id>
More info:
http://gitready.com/beginner/2009/01/10/stashing-your-changes.html
http://gitready.com/beginner/2009/03/13/smartly-save-stashes.html
7.Othercommands
● Temporarily ignoring files locally:
- git update-index --assume-unchanged <file>
- git update-index --no-assume-unchanged <file>
More info: http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html
● Pick out individual commits:
- git cherry-pick <commit>
More info: http://gitready.com/intermediate/2009/03/04/pick-out-individual-commits.html
8.gitautocomplete
Autocomplete Git Commands and Branch Names in Bash:
http://code-worrier.com/blog/autocomplete-git/
Usefullinks
● Good tips: http://gitready.com/
● Advanced: https://www.atlassian.com/git/tutorials/advanced-overview
● Git Community Book: http://git-scm.com/book/en/v2
Iván Palma | ipalma@mobaires.com
Ad

More Related Content

What's hot (20)

Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Git
GitGit
Git
Shinu Suresh
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
Steven Hamblin
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
Safique Ahmed Faruque
 
Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
Arnaud Seilles
 
Git presentation
Git presentationGit presentation
Git presentation
Vikas Yaligar
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Colin Su
 
Git & GitHub for Beginners
Git & GitHub for BeginnersGit & GitHub for Beginners
Git & GitHub for Beginners
Sébastien Saunier
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Git learning
Git learningGit learning
Git learning
Amit Gupta
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
Jon Senchyna
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
Edward Goikhman
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
TingYen Lee
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
Ariejan de Vroom
 
Git basics
Git basicsGit basics
Git basics
Denys Haryachyy
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
KMS Technology
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
Steven Hamblin
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Colin Su
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
E Carter
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
Christoph Matthies
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
Jon Senchyna
 
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Simplilearn
 
Git Basics at Rails Underground
Git Basics at Rails UndergroundGit Basics at Rails Underground
Git Basics at Rails Underground
Ariejan de Vroom
 

Viewers also liked (20)

Git basic
Git basicGit basic
Git basic
Jinhan Heo
 
Git 101 tutorial presentation
Git 101 tutorial presentationGit 101 tutorial presentation
Git 101 tutorial presentation
Terry Wang
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Elli Kanal
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
Naresh Jain
 
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
민태 김
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
Chia Wei Tsai
 
Power Sampling Reaches Consumers At Home
Power Sampling Reaches Consumers At HomePower Sampling Reaches Consumers At Home
Power Sampling Reaches Consumers At Home
bborneman
 
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
Yaroslav Birzool
 
MIGUEL HERNÁNDEZ CENTENARIO
MIGUEL HERNÁNDEZ CENTENARIOMIGUEL HERNÁNDEZ CENTENARIO
MIGUEL HERNÁNDEZ CENTENARIO
Araceli Villalba
 
Education 3.0
Education 3.0Education 3.0
Education 3.0
Michael Simkins
 
Template มคอ. 5
Template มคอ. 5Template มคอ. 5
Template มคอ. 5
Aichom Naja
 
Skoda Yeti Launch 2009
Skoda Yeti Launch 2009Skoda Yeti Launch 2009
Skoda Yeti Launch 2009
Frank Communication
 
Pedro López de alda
Pedro López de aldaPedro López de alda
Pedro López de alda
Student
 
Future of the ICT is now!
Future of the ICT is now!Future of the ICT is now!
Future of the ICT is now!
Tomo Popovic
 
Comunicación Digital para proyectos de desarrollo
Comunicación Digital para proyectos de desarrolloComunicación Digital para proyectos de desarrollo
Comunicación Digital para proyectos de desarrollo
Héctor Rodríguez
 
Graham 6pix power point presentation
Graham 6pix power point presentationGraham 6pix power point presentation
Graham 6pix power point presentation
grahamangela3333
 
Clay'’s Life and Family
Clay'’s Life and FamilyClay'’s Life and Family
Clay'’s Life and Family
supercas57
 
BcnCoolHunter N8 Mayo 2016
BcnCoolHunter N8 Mayo 2016BcnCoolHunter N8 Mayo 2016
BcnCoolHunter N8 Mayo 2016
Dafne Patruno
 
Csis 1514 excel ch 1 ppt
Csis 1514 excel ch 1 pptCsis 1514 excel ch 1 ppt
Csis 1514 excel ch 1 ppt
Hamdani Nurdin
 
Git 101 tutorial presentation
Git 101 tutorial presentationGit 101 tutorial presentation
Git 101 tutorial presentation
Terry Wang
 
Inverting The Testing Pyramid
Inverting The Testing PyramidInverting The Testing Pyramid
Inverting The Testing Pyramid
Naresh Jain
 
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
초보자를 위한 정규 표현식 가이드 (자바스크립트 기준)
민태 김
 
Power Sampling Reaches Consumers At Home
Power Sampling Reaches Consumers At HomePower Sampling Reaches Consumers At Home
Power Sampling Reaches Consumers At Home
bborneman
 
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
доклад «о процессе работы в Ux depot на примере кейса i pogoda.ru»
Yaroslav Birzool
 
MIGUEL HERNÁNDEZ CENTENARIO
MIGUEL HERNÁNDEZ CENTENARIOMIGUEL HERNÁNDEZ CENTENARIO
MIGUEL HERNÁNDEZ CENTENARIO
Araceli Villalba
 
Template มคอ. 5
Template มคอ. 5Template มคอ. 5
Template มคอ. 5
Aichom Naja
 
Pedro López de alda
Pedro López de aldaPedro López de alda
Pedro López de alda
Student
 
Future of the ICT is now!
Future of the ICT is now!Future of the ICT is now!
Future of the ICT is now!
Tomo Popovic
 
Comunicación Digital para proyectos de desarrollo
Comunicación Digital para proyectos de desarrolloComunicación Digital para proyectos de desarrollo
Comunicación Digital para proyectos de desarrollo
Héctor Rodríguez
 
Graham 6pix power point presentation
Graham 6pix power point presentationGraham 6pix power point presentation
Graham 6pix power point presentation
grahamangela3333
 
Clay'’s Life and Family
Clay'’s Life and FamilyClay'’s Life and Family
Clay'’s Life and Family
supercas57
 
BcnCoolHunter N8 Mayo 2016
BcnCoolHunter N8 Mayo 2016BcnCoolHunter N8 Mayo 2016
BcnCoolHunter N8 Mayo 2016
Dafne Patruno
 
Csis 1514 excel ch 1 ppt
Csis 1514 excel ch 1 pptCsis 1514 excel ch 1 ppt
Csis 1514 excel ch 1 ppt
Hamdani Nurdin
 
Ad

Similar to Git tutorial (20)

Git tips
Git tipsGit tips
Git tips
Arthur Shvetsov
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
Git github
Git githubGit github
Git github
Anurag Deb
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Katie Sylor-Miller
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Use Git like a pro - condensed
Use Git like a pro - condensedUse Git like a pro - condensed
Use Git like a pro - condensed
Jesús Miguel Benito Calzada
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
Shinho Kang
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
Nuno Caneco
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
Introduction to Git (part 2)
Introduction to Git (part 2)Introduction to Git (part 2)
Introduction to Git (part 2)
Salvatore Cordiano
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
LearningTech
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Git slides
Git slidesGit slides
Git slides
Nanyak S
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
sample.pptx
sample.pptxsample.pptx
sample.pptx
UshaSuray
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
390a gitintro 12au
390a gitintro 12au390a gitintro 12au
390a gitintro 12au
Nguyen Van Hung
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control system
AlbanLevy
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
Anuchit Chalothorn
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
Sebin Benjamin
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Katie Sylor-Miller
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid Hosseini
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
Shinho Kang
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
Susan Tan
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
Nuno Caneco
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
DSC GVP
 
Git tutorial undoing changes
Git tutorial   undoing changesGit tutorial   undoing changes
Git tutorial undoing changes
LearningTech
 
Introduction to git, a version control system
Introduction to git, a version control systemIntroduction to git, a version control system
Introduction to git, a version control system
Kumaresh Chandra Baruri
 
Git slides
Git slidesGit slides
Git slides
Nanyak S
 
Intro to git and git hub
Intro to git and git hubIntro to git and git hub
Intro to git and git hub
Venkat Malladi
 
Introduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control systemIntroduction to git, an efficient distributed version control system
Introduction to git, an efficient distributed version control system
AlbanLevy
 
Ad

Recently uploaded (20)

Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 

Git tutorial

  • 2. Index ● Git Basics ● Useful when collaborating ● More advanced stuff
  • 3. Gitbasics Basics and prerequisites to follow this guide: ● Try Git: https://try.github.io/ ● Git The Three States: https://git-scm.com/book/en/v2/Getting-Started-Git- Basics#The-Three-States a. Committed (data in the repo) b. Modified (file changed but not committed) c. Staged (marked a modified file to go into your next commit) ● Understanding Git Conceptually: http://www.sbf5.com/~cduan/technical/git/ a. Repositories b. Branching c. Merging d. Collaborating e. Rebasing
  • 4. USefulwhencollaborating 1. Fork 2. Pull Requests 3. Remotes 4. Merge vs Rebase
  • 5. 1. fork A fork is a copy of a repository, that allows you to freely experiment without affecting the original project. Usual workflow: ● Fork the repository. ● Make the fix. ● Submit a pull request to the project owner. More info: https://help.github.com/articles/fork-a-repo/
  • 6. 2.pullrequests Pull requests let you tell others about changes you've pushed to a repository on GitHub. A pull request let pull your fix from your fork into the original repository. It allows: ● Review proposed changes ● Discuss changes ● Merge changes More info: https://help.github.com/articles/using-pull-requests/
  • 7. 3.Remotes Remote repositories are versions of your project that are hosted on the network. Collaborating with others involves managing these remote repositories. Useful commands: ● Show remotes: git remote -v ● Add remote: git remote add [shortname] [url] ● Rename remote: git remote rename [shortname] [newname] ● Remove remote: git remote rm [shortname] More info: https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
  • 8. 4.mergevsRebase Both of these commands are designed to integrate changes from one branch into another branch—they just do it in very different ways. It’s easier to see what both commands do with the following example: 1. Start working on a new feature in a dedicated branch. 2. A team member updates the master branch with new commits. 3. To incorporate the new commits into your feature branch, you have two options: merging or rebasing.
  • 9. 4.mergevsRebase The Merge Option: git checkout feature git merge master or git merge master feature This creates a new “merge commit” in the feature branch. Merging: ● It’s a non-destructive operation (the existing branches are not changed). ● The feature branch will have an extraneous merge commit every time you need to incorporate upstream changes.
  • 10. 4.mergevsRebase The Rebase Option: git checkout feature git rebase master This moves the feature branch to begin on the tip of the master branch. Rebasing: ● Cleaner project history (new commit for each commit in the original branch). ● Results in a perfectly linear project history.
  • 11. 4.mergevsRebase Important things for Rebase ● The Golden Rule of Rebasing: never use it on public branches. ● Force-Pushing: git push --force. This overwrites the remote master branch to match the rebased one from your repository. More info: https://www.atlassian.com/git/tutorials/merging-vs-rebasing https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase/
  • 12. Moreadvancedstuff 1. Reset 2. Checkout 3. Revert 4. Reflog 5. Log 6. Stash 7. Other commands 8. Git Autocomplete
  • 13. 1. reset On the commit-level, moves the tip of a branch to a different commit. Example: git reset HEAD~2
  • 14. 1. reset Flags: --soft, --mixed and --hard. Examples: git reset --mixed HEAD Unstage all changes, but leaves them in the working directory git reset --hard HEAD Completely throw away all your uncommitted changes
  • 15. 2.checkout Most common usage: switch between branches: git checkout hotfix . You can also check out arbitrary commits: git checkout HEAD~2 . However, since there is no branch reference to the current HEAD, this puts you in a detached HEAD state.
  • 16. 3.revert Undoes a commit by creating a new commit. This is a safe way to undo changes. Example: git revert HEAD~2
  • 17. summary:Reset-Checkout-Revert Command Scope Common use cases git reset Commit-level Discard commits in a private branch or throw away uncommited changes git reset File-level Unstage a file git checkout Commit-level Switch between branches or inspect old snapshots git checkout File-level Discard changes in the working directory git revert Commit-level Undo commits in a public branch git revert File-level (N/A) More info: https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting
  • 18. 4.reflog It records almost every change you make in your repository. You can think of it is a chronological history of everything you’ve done in your local repo. Example: you can use this to revert to a state that would otherwise be lost, like restoring some lost commits. git reflog
  • 19. 5.Log Shows the commit logs. There are some useful flags that let you format or filter the output: ● --oneline ● --decorate (display all of the references) ● --graph ● --max-count= ● --author=<pattern> ● --grep=<pattern> More info: http://git-scm.com/docs/git-log
  • 20. 6.stash Let you pause what you’re currently working on and come back to it later. Useful stash commands: ● git stash / git stash save <message> ● git stash apply / git stash pop ● git stash list ● git stash drop <id> More info: http://gitready.com/beginner/2009/01/10/stashing-your-changes.html http://gitready.com/beginner/2009/03/13/smartly-save-stashes.html
  • 21. 7.Othercommands ● Temporarily ignoring files locally: - git update-index --assume-unchanged <file> - git update-index --no-assume-unchanged <file> More info: http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html ● Pick out individual commits: - git cherry-pick <commit> More info: http://gitready.com/intermediate/2009/03/04/pick-out-individual-commits.html
  • 22. 8.gitautocomplete Autocomplete Git Commands and Branch Names in Bash: http://code-worrier.com/blog/autocomplete-git/
  • 23. Usefullinks ● Good tips: http://gitready.com/ ● Advanced: https://www.atlassian.com/git/tutorials/advanced-overview ● Git Community Book: http://git-scm.com/book/en/v2 Iván Palma | [email protected]