SlideShare a Scribd company logo
Git Workshop
by Kugathasan Abimaran
Getting Git
Why Version Control?
• Made a change to code, realized it was a mistake and wanted
to go back?
• You don't lose anything.
• I never again commented out code, I simply delete it
• Working as a Team..?
• Wanted to experiment new feature without affecting working
code?
• What did I do yesterday?
• Wanted Copy of Copy of Copy of Project?
Git
• A directory content management system
• Download & Install
– http://msysgit.github.com/
• git help
• git <command> -h
• $HOME/.gitconfig
– git config --global user.name “Kugathasan Abimaran"
– git config --global user.email development@domain51.com
– git config --global color.ui true
GitHub
• Build Software Better and Together.
• Create a GitHub account
• Install GitHub for Windows from here
– http://github-
windows.s3.amazonaws.com/GitHubSetup.exe
• World largest open source community
• Create own repository
• Work on your dream project..?
Create/Clone
• Create a git repository
– git init
• Obtains a copy of a project for you with entire
history
• Valid URLs are project directory names by
various protocols
– git clone git@github.com:abi-maran/demo.git
– git clone https://github.com/abi-maran/demo.git
• Clone the repository from
https://github.com/abi-maran/demo
Commit
• Git uses two-step process to get changes into
the repository.
– Staging changes adds it to index or staging area.
– Commit
Commit …
• Each commit needs a commit message.
• Git don’t track empty directories
• git status
Fix/Revert Commit
• Change last commit
– git commit –amend
• Unmodify modified file
– git checkout -- file.py
• Git revert <commit-id>
• By creating new commit that reverse the
commit
Differences
• git diff – changes between index and working
files
• git diff HEAD
• git diff --stat
• git diff $commit $commit
• git log
Pull/Push to Repo
• git pull <remote> <rbranch>
• git push <remote> <rbranch>
Ignoring Files
• For the which you don’t want to add in git
repo forever!
• .gitignore file – a project specific file
• .git/info/excludes – global
Stashing
• To save uncommitted files and return clean
repo
– git stash “description”
– Do that work
– git stash apply
Branch
• Master is the default branch
• git branch –l / -r / -a
• Create a branch
– git branch name
• git checkout branch
Merge Branches
• To share changes between branches
• Fast-forward merge
• Recursively merge
• Cherry-pick
Conflicts
• When both changes the same line of code
<<<<<<< HEAD
def _handle_response(self, response, data=[], raw=False):
return data if raw else simplejson.loads(data)
=======
def _handle_response(self, response, raw=False, data=[]):
if raw:
return data
return simplejson.loads(data)
>>>>>>> added_raw
git merge tool
Tag
• To mark milestones in your project such as
releases.
• Read only
GUI/References
• Gitk – for Linux
• Git Extentions – For Windows
• Home Page : http://www.git-scm.com/
• Reference : http://gitref.org/
For more information
General
Careers
Web
: info@hsenidmobile.com
: careers@hsenidmobile.com
: www.hSenidMobile.com

More Related Content

What's hot (20)

Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
Mireia Sangalo
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
Gourav Varma
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
GDSCIIITBbsr
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
DSCVSSUT
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
Jiwon Baek
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Md Atique Ahmed Ziad
 
Git 101
Git 101Git 101
Git 101
Sachet Mittal
 
Library Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction SlidesLibrary Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction Slides
Sarah Anna Stewart
 
Git and Github Session
Git and Github SessionGit and Github Session
Git and Github Session
GoogleDevelopersStud1
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
Introduction to Git and GitHub Part 2
Introduction to Git and GitHub Part 2Introduction to Git and GitHub Part 2
Introduction to Git and GitHub Part 2
Omar Fathy
 
Git basics
Git basicsGit basics
Git basics
Ashwin Date
 
Git theory
Git   theoryGit   theory
Git theory
hariprasad1035
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
Github
GithubGithub
Github
piyush khadse
 
Git with bitbucket
Git with bitbucketGit with bitbucket
Git with bitbucket
Suhas Shivaram
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
Omar Fathy
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
 
Git-r-Done
Git-r-DoneGit-r-Done
Git-r-Done
Cesar Martinez
 
GitHub Talk - Cody Carnachan
GitHub Talk - Cody CarnachanGitHub Talk - Cody Carnachan
GitHub Talk - Cody Carnachan
Cody Carnachan
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
Mireia Sangalo
 
Version control git day03
Version control   git day03Version control   git day03
Version control git day03
Gourav Varma
 
HacktoberFest-Git&GitHub
HacktoberFest-Git&GitHubHacktoberFest-Git&GitHub
HacktoberFest-Git&GitHub
GDSCIIITBbsr
 
Workshop on Git and GitHub
Workshop on Git and GitHubWorkshop on Git and GitHub
Workshop on Git and GitHub
DSCVSSUT
 
Library Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction SlidesLibrary Carpentry Git, GitHub and GitPages Introduction Slides
Library Carpentry Git, GitHub and GitPages Introduction Slides
Sarah Anna Stewart
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
LearningTech
 
Introduction to Git and GitHub Part 2
Introduction to Git and GitHub Part 2Introduction to Git and GitHub Part 2
Introduction to Git and GitHub Part 2
Omar Fathy
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
RajKharvar
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
Omar Fathy
 
GitHub Talk - Cody Carnachan
GitHub Talk - Cody CarnachanGitHub Talk - Cody Carnachan
GitHub Talk - Cody Carnachan
Cody Carnachan
 

Similar to Git workshop - University of Moratuwa, Department of Computer Science and Engineering (20)

Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
gdsc13
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
 
Techoalien git
Techoalien gitTechoalien git
Techoalien git
Aditya Tiwari
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
Muhil Vannan
 
GitHub_For_Beginners_Presentationss.pptx
GitHub_For_Beginners_Presentationss.pptxGitHub_For_Beginners_Presentationss.pptx
GitHub_For_Beginners_Presentationss.pptx
ramyagirish78
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
Max Claus Nunes
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
Kishor Kumar
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
BigBlueHat
 
Introduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptxIntroduction to git and githhub with practicals.pptx
Introduction to git and githhub with practicals.pptx
Abdul Salam
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
glen_a_smith
 
Git session Dropsolid.com
Git session Dropsolid.comGit session Dropsolid.com
Git session Dropsolid.com
dropsolid
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
gdsc13
 
11 git version control
11 git version control11 git version control
11 git version control
Wasim Alatrash
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
Muhil Vannan
 
GitHub_For_Beginners_Presentationss.pptx
GitHub_For_Beginners_Presentationss.pptxGitHub_For_Beginners_Presentationss.pptx
GitHub_For_Beginners_Presentationss.pptx
ramyagirish78
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 
Let's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHubLet's Git this Party Started: An Introduction to Git and GitHub
Let's Git this Party Started: An Introduction to Git and GitHub
Kim Moir
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
Max Claus Nunes
 

Recently uploaded (20)

Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
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
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
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
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
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
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
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
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
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
 
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
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
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
 
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
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
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
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
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
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
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
 
Expand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchangeExpand your AI adoption with AgentExchange
Expand your AI adoption with AgentExchange
Fexle Services Pvt. Ltd.
 
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
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
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
 
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
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
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
 
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
 

Git workshop - University of Moratuwa, Department of Computer Science and Engineering

  • 3. Why Version Control? • Made a change to code, realized it was a mistake and wanted to go back? • You don't lose anything. • I never again commented out code, I simply delete it • Working as a Team..? • Wanted to experiment new feature without affecting working code? • What did I do yesterday? • Wanted Copy of Copy of Copy of Project?
  • 4. Git • A directory content management system • Download & Install – http://msysgit.github.com/ • git help • git <command> -h • $HOME/.gitconfig – git config --global user.name “Kugathasan Abimaran" – git config --global user.email [email protected] – git config --global color.ui true
  • 5. GitHub • Build Software Better and Together. • Create a GitHub account • Install GitHub for Windows from here – http://github- windows.s3.amazonaws.com/GitHubSetup.exe • World largest open source community • Create own repository • Work on your dream project..?
  • 6. Create/Clone • Create a git repository – git init • Obtains a copy of a project for you with entire history • Valid URLs are project directory names by various protocols – git clone [email protected]:abi-maran/demo.git – git clone https://github.com/abi-maran/demo.git • Clone the repository from https://github.com/abi-maran/demo
  • 7. Commit • Git uses two-step process to get changes into the repository. – Staging changes adds it to index or staging area. – Commit
  • 8. Commit … • Each commit needs a commit message. • Git don’t track empty directories • git status
  • 9. Fix/Revert Commit • Change last commit – git commit –amend • Unmodify modified file – git checkout -- file.py • Git revert <commit-id> • By creating new commit that reverse the commit
  • 10. Differences • git diff – changes between index and working files • git diff HEAD • git diff --stat • git diff $commit $commit • git log
  • 11. Pull/Push to Repo • git pull <remote> <rbranch> • git push <remote> <rbranch>
  • 12. Ignoring Files • For the which you don’t want to add in git repo forever! • .gitignore file – a project specific file • .git/info/excludes – global
  • 13. Stashing • To save uncommitted files and return clean repo – git stash “description” – Do that work – git stash apply
  • 14. Branch • Master is the default branch • git branch –l / -r / -a • Create a branch – git branch name • git checkout branch
  • 15. Merge Branches • To share changes between branches • Fast-forward merge • Recursively merge • Cherry-pick
  • 16. Conflicts • When both changes the same line of code <<<<<<< HEAD def _handle_response(self, response, data=[], raw=False): return data if raw else simplejson.loads(data) ======= def _handle_response(self, response, raw=False, data=[]): if raw: return data return simplejson.loads(data) >>>>>>> added_raw git merge tool
  • 17. Tag • To mark milestones in your project such as releases. • Read only
  • 18. GUI/References • Gitk – for Linux • Git Extentions – For Windows • Home Page : http://www.git-scm.com/ • Reference : http://gitref.org/