Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by...
Transcript of Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by...
![Page 1: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/1.jpg)
Yet Another GIT Tutorial
by Giso H. Dal
Version 2.2
![Page 2: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/2.jpg)
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 3: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/3.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 4: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/4.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Why version control?
For the individual, have you ever:Made a change to your code, realised it was a mistake and wanted torevert back?Lost code or had a backup that was too old?Had to maintain multiple versions of a product?Wanted to see the difference between multiple versions of your code?Wanted to experiment with a new feature without interfering withworking code?Wanted to synchronize your work across multiple devices?
For the group, have you ever:Wanted to work together on the same project on the same file, at thesame time?Wanted to share your code, or let other people work on your code?Wanted to see how much work is being done, where, when and bywhom?
![Page 5: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/5.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 6: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/6.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 7: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/7.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 8: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/8.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 9: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/9.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 10: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/10.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 11: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/11.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 12: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/12.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Centralized Version Control
Client-Server
Peer-to-Peer
Server
Bob Phil Amy
![Page 13: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/13.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 14: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/14.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 15: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/15.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 16: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/16.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 17: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/17.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 18: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/18.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 19: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/19.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 20: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/20.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 21: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/21.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-ServerPeer-to-Peer
Server
Bob Phil Amy
![Page 22: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/22.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Distributed Version Control
Client-Server
Peer-to-Peer
Server
Bob Phil Amy
![Page 23: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/23.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion vs GIT
Subversion GIT
Repository Model Client-Server DistributedDevelopment Active ActiveRevision IDs Numbers SHA-1 HashesBranching/Merging Hard; Directory Easy; SnapshotPartial Checkout Yes NoSupported Formats subversion git, cvs, subversion,
hg, any that has a fas-texporter
Support Large Files Yes NoPerformance Slow FastBisect Third party YesFile Locking Yes NoWork Offline No YesCreate Repository Only admin Any userReliablility Reasonable VeryRepository size Reasonable SmallMerge type Implicit Explicit
![Page 24: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/24.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bobfile1 file2 file3
Commit
Philfile1 file2 file3
CommitUpdateMerge
Amy
file1 file2 file3
Tim
e
3
4
1
2 3 4
5
6
![Page 25: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/25.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
1
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 26: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/26.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
1
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 27: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/27.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 28: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/28.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 29: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/29.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
3
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 30: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/30.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
3
file2
1
file3
Commit
UpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 31: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/31.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
3
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
4
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 32: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/32.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
3
file2
1
file3
Commit
Update
Merge
Amy
1
file1
1
file2
4
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 33: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/33.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Subversion Workflow
Commit
Bob
2
file1
1
file2
1
file3
Commit
Phil
1
file1
3
file2
1
file3
CommitUpdateMerge
Amy
2
file1
3
file2
4
file3
Tim
e
3
4
1
2
3 4
5
6
![Page 34: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/34.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
GIT Workflow
Commit
Bob
1
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
CommitUpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 35: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/35.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
GIT Workflow
Commit
Bob
1
file1
1
file2
1
file3
Commit
Phil
1
file1
1
file2
1
file3
Commit
UpdateMerge
Amy
1
file1
1
file2
1
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 36: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/36.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
GIT Workflow
Commit
Bob
2
file1
2
file2
2
file3
Commit
Phil
3
file1
3
file2
3
file3
CommitUpdate
Merge
Amy
4
file1
4
file2
4
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 37: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/37.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
GIT Workflow
Commit
Bob
2
file1
2
file2
2
file3
Commit
Phil
3
file1
3
file2
3
file3
CommitUpdate
Merge
Amy
5
file1
5
file2
5
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 38: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/38.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
GIT Workflow
Commit
Bob
2
file1
2
file2
2
file3
Commit
Phil
3
file1
3
file2
3
file3
CommitUpdateMerge
Amy
6
file1
6
file2
6
file3
Tim
e
3
4
1
2 3 4
5
6
![Page 39: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/39.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 40: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/40.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: GIT Architecture
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 41: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/41.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands
Local repository
Creating local repositoryUsing version control
Remote repository
Creating and connecting to remote repositorySetup server without root priviledges
![Page 42: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/42.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Local Repository
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 43: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/43.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 44: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/44.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 45: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/45.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
>
echo ’hello 1’ > file1>
echo ’hello 2’ > file2
>
git init
>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1
hello 1hello 5
file2
hello 2
file3hello 4
hello 7
![Page 46: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/46.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1
>
echo ’hello 2’ > file2
>
git init
>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1
hello 1hello 5
file2
hello 2
file3hello 4
hello 7
![Page 47: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/47.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1>
echo ’hello 2’ > file2>
git init
>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2
hello 2
file3hello 4
hello 7
![Page 48: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/48.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2
>
git init
>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2
hello 2
file3hello 4
hello 7
![Page 49: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/49.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2>
git init>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 50: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/50.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init
>
git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 51: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/51.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init>
git add .>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 52: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/52.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .
>
git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 53: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/53.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .>
git commit -m ’initial’>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Indexfile1 file2
file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 54: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/54.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’
>
echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
Local Repository
1 2
3 4
5 6
7
Indexfile1 file2
file3
Staging Area
file1 file2 file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 55: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/55.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’>
echo ’hello 3’ >> file2>
git add .
>
git commit -m ’updated file2’
>
master
Local Repository
1
2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 56: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/56.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2
>
git add .
>
git commit -m ’updated file2’
>
master
Local Repository
1
2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 57: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/57.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2>
git add .>
git commit -m ’updated file2’
>
master
Local Repository
1
2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 58: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/58.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2> git add .
>
git commit -m ’updated file2’
>
master
Local Repository
1
2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 59: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/59.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2> git add .>
git commit -m ’updated file2’>
master
Local Repository
1
2
3 4
5 6
7
Indexfile1 file2
file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 60: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/60.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2> git add .> git commit -m ’updated file2’
>
master
Local Repository
1
2
3 4
5 6
7
Indexfile1 file2
file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 61: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/61.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Committing
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> git init> git add .> git commit -m ’initial’> echo ’hello 3’ >> file2> git add .> git commit -m ’updated file2’>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 62: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/62.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 63: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/63.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 64: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/64.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
>
echo ’hello 4’ > file3>
echo ’hello 5’ >> file1
>
git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 65: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/65.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 66: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/66.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3>
echo ’hello 5’ >> file1>
git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 67: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/67.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1
>
git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 68: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/68.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1>
git status# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 69: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/69.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 70: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/70.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git logcommit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 71: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/71.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git log
commit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 72: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/72.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git logcommit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
>
git diff file1diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 73: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/73.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git logcommit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
> git diff file1
diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 74: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/74.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Status
> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch master
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git logcommit 2
Author: Its Me
Date: Feb 6 15:21:38 2014
updated file2
...
> git diff file1diff --git a/file1 b/file1
hello 1
+hello 5
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 75: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/75.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 76: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/76.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 77: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/77.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
>
git checkout 1>
git branch foo
>
git checkout foo
>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 78: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/78.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1
>
git branch foo
>
git checkout foo
>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 79: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/79.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1>
git branch foo>
git checkout foo
>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 80: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/80.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo
>
git checkout foo
>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 81: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/81.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo>
git checkout foo>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 82: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/82.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo
>
echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 83: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/83.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo>
echo ’hello 4’ > file3>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 84: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/84.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3
>
echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 85: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/85.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3>
echo ’hello 5’ >> file1>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 86: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/86.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1
>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2
file3hello 4
hello 7
![Page 87: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/87.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1>
git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 88: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/88.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 89: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/89.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
>
git commit -am ’updated file1’>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 90: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/90.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’
>
echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Indexfile1
file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 91: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/91.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’>
echo ’hello 6’ >> file2>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3
4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 92: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/92.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’> echo ’hello 6’ >> file2
>
git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3
4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2
file3hello 4
hello 7
![Page 93: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/93.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’> echo ’hello 6’ >> file2>
git commit -am ’updated file2’>
master
foo
Local Repository
1 2
3
4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 6
file3hello 4
hello 7
![Page 94: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/94.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’> echo ’hello 6’ >> file2> git commit -am ’updated file2’
>
master
foo
Local Repository
1 2
3
4
5 6
7
Index
file1
file2
file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 6
file3hello 4
hello 7
![Page 95: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/95.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Branching
> git checkout 1> git branch foo> git checkout foo> echo ’hello 4’ > file3> echo ’hello 5’ >> file1> git status
# On branch foo
# Changes not staged.. :
# modified: file1
#
# Untracked files:
# file3
> git commit -am ’updated file1’> echo ’hello 6’ >> file2> git commit -am ’updated file2’>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 6
file3hello 4
hello 7
![Page 96: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/96.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 97: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/97.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 98: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/98.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
>
git checkout master>
git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
>
vim file2
>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 6
file3hello 4
hello 7
![Page 99: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/99.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master
>
git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
>
vim file2
>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 6
file3hello 4
hello 7
![Page 100: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/100.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master>
git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
>
vim file2
>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 101: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/101.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
>
vim file2
>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 102: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/102.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
>
vim file2>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2<<< headhello 3==hello 6>>> foo
file3hello 4
hello 7
![Page 103: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/103.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2
>
git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2<<< headhello 3==hello 6>>> foo
file3hello 4
hello 7
![Page 104: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/104.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2>
git add .>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 105: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/105.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2> git add .
>
git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 106: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/106.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2> git add .>
git commit -m ’foo merged’>
master
foo
Local Repository
1 2
3 4
5 6
7
Indexfile1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 107: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/107.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2> git add .> git commit -m ’foo merged’
>
master
foo
Local Repository
1 2
3 4
5 6
7
Indexfile1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 108: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/108.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Merging
> git checkout master> git merge foo
Auto-merging file2
CONFLICT (content):
Merge conflict in file2
Automatic merge failed;
fix conflicts and commit.
> vim file2> git add .> git commit -m ’foo merged’>
master
foo
Local Repository
1 2
3 4
5
6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 109: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/109.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
1 Committing
2 Status
3 Branching
4 Merging
5 Revert, Reset and Delete
![Page 110: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/110.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 111: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/111.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
>
echo ’hello 7’ >> file3>
git commit -am ’updated file3’
>
git revert 6
>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5
6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 112: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/112.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3
>
git commit -am ’updated file3’
>
git revert 6
>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5
6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 113: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/113.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3>
git commit -am ’updated file3’>
git revert 6
>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5
6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4hello 7
![Page 114: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/114.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’
>
git revert 6
>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5
6
7
Index
file1 file2
file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4hello 7
![Page 115: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/115.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’>
git revert 6>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4hello 7
![Page 116: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/116.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6
>
git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
foo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4hello 7
![Page 117: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/117.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6>
git branch -d foo>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
masterfoo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 118: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/118.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo
>
git reset
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
masterfoo
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 119: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/119.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo>
git reset> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 120: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/120.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset --hard 2
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 121: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/121.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset --hard 2>
dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1
hello 5
file2hello 2hello 3
file3hello 4
hello 7
![Page 122: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/122.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset (--mixed) 2
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 123: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/123.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset (--mixed) 2>
dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2
file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 124: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/124.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset --soft 2
> dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 125: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/125.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Revert, Reset and Delete
> echo ’hello 7’ >> file3> git commit -am ’updated file3’> git revert 6> git branch -d foo> git reset --soft 2>
dsljf lksjd flkjasdfl aksjd flaksjdflaksdjf lak alsdj alfksdj
master
Local Repository
1 2
3 4
5 6
7
Index
file1 file2 file3
Staging Areafile1 file2 file3
Workspace
file1hello 1hello 5
file2hello 2hello 3hello 6
file3hello 4
hello 7
![Page 126: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/126.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Local Repository
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 127: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/127.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Remote Repository
1 Creating and Connecting
2 Push and Pull
![Page 128: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/128.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
1 Creating and Connecting
2 Push and Pull
![Page 129: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/129.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 130: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/130.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local>
ssh [email protected]>
mkdir ∼/project.git
remote>
cd ∼/project.git
remote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 131: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/131.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]
remote>
mkdir ∼/project.git
remote>
cd ∼/project.git
remote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 132: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/132.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]>
mkdir ∼/project.gitremote>
cd ∼/project.git
remote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 133: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/133.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.git
remote>
cd ∼/project.git
remote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 134: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/134.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote>
cd ∼/project.gitremote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 135: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/135.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.git
remote>
git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 136: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/136.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote>
git init --bareremote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 137: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/137.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bare
remote>
logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 138: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/138.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote>
logoutlocal>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 139: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/139.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logout
local>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 140: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/140.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal>
git remote add origin \[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 141: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/141.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.git
local>
git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 142: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/142.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal>
git push origin masterlocal>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 143: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/143.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin master
local>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
1 2
![Page 144: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/144.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal>
git branch -u \origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 145: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/145.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal> git branch -u \
origin/master master
local>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 146: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/146.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal> git branch -u \
origin/master masterlocal>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 147: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/147.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal> git branch -u \
origin/master masterlocal>
Remote exists:
local>
git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
Local Repository
1 2
Staging Area
file1 file2
Remote Repository
origin
master
1 2
![Page 148: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/148.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal> git branch -u \
origin/master masterlocal>
Remote exists:
local> git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
Local Repository
1 2
Staging Area
file1 file2
Remote Repository
origin
master
1 2
![Page 149: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/149.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Creating and Connecting
Remote does not exists:
local> ssh [email protected]> mkdir ∼/project.gitremote> cd ∼/project.gitremote> git init --bareremote> logoutlocal> git remote add origin \
[email protected]:∼/project.gitlocal> git push origin masterlocal> git branch -u \
origin/master masterlocal>
Remote exists:
local> git clone \[email protected]:∼/project.git
Cloning into ’project’...local>
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 150: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/150.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
1 Creating and Connecting
2 Push and Pull
![Page 151: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/151.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 152: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/152.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
>
git push>
Remote is ahead of Local
>
git pull
>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1
2
![Page 153: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/153.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
> git push
>
Remote is ahead of Local
>
git pull
>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1
2
![Page 154: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/154.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
> git push>
Remote is ahead of Local
>
git pull
>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 155: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/155.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
> git push>
Remote is ahead of Local
>
git pull>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1
2
Staging Areafile1
file2
Remote Repository
origin
master
1 2
![Page 156: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/156.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
> git push>
Remote is ahead of Local
> git pull
>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1
2
Staging Areafile1
file2
Remote Repository
origin
master
1 2
![Page 157: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/157.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Push and Pull
Local is ahead of Remote
> git push>
Remote is ahead of Local
> git pull>
git pull = git fetch & git merge
(upstream)
master
Local Repository
1 2
Staging Areafile1 file2
Remote Repository
origin
master
1 2
![Page 158: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/158.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Remote Repository
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 159: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/159.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 160: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/160.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Committing
Local Remote
init*
add*
commit*
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 161: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/161.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Status
Local Remote
init
add
commit
status*log*
diff*
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 162: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/162.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Branching
Local Remote
init
add
commit
statuslog
diff
checkout*
branch*merge*
t
revert
reset
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 163: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/163.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Alter Commit History
Local Remote
init
add
commit
statuslog
diff
checkout
branch*merge
t
revert*
reset*
remote
branch -u
clonepush
fetchpull
Workspace Staging Index+Repo Repo
![Page 164: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/164.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Connect to Remote
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote*
branch -u*
clone*push
fetchpull
Workspace Staging Index+Repo Repo
![Page 165: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/165.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
The Commands: Local-Remote Data Exchange
Local Remote
init
add
commit
statuslog
diff
checkout
branchmerge
t
revert
reset
remote
branch -u
clonepush*
fetch*pull*
Workspace Staging Index+Repo Repo
![Page 166: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/166.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 167: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/167.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow
We have seen WHAT commands to use,a workflow determines HOW to use them.
![Page 168: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/168.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: The Wrong Way!
master
develop feature
Initial commit
First release
New function with bug
Bug fixed
Minor Improvement
Second release
Minor improvement
Second release
1
2
3
4
5
6
7
8
![Page 169: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/169.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
7
8
![Page 170: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/170.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
7
8
![Page 171: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/171.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
7
8
![Page 172: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/172.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
7
8
![Page 173: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/173.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
4
7
8
![Page 174: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/174.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
4
5
7
8
![Page 175: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/175.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
4
5
6
7
8
![Page 176: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/176.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
4
5
6
7
8
![Page 177: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/177.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Workflow: Adding Structure
master develop feature
Initial commit
Working version
First release
New function with bug
Bug fixed
Update working version
Minor improvement
Second release
1
2
3
4
5
6
7
8
![Page 178: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/178.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Outline
1 Introduction
2 ArchitectureCVCS vs DVCSSVN vs GIT
3 CommandsLocal RepositoryRemote Repository
4 Workflow
5 Tips and Tricks
![Page 179: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/179.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best Practice Tips
Ignore (Temporary) Files or Directories
Create Custom Commands
![Page 180: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/180.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 181: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/181.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 182: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/182.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 183: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/183.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 184: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/184.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 185: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/185.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 186: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/186.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Tips and Tricks
Best practice
1 Use a development branch next to a release branch.2 Pull before Push.3 Append .git to directory of remote repository, e.g.,
project.git.4 GIT server without root privileges: use Gitolite to allow
other people access to repositories on your account. (orthe hard way: restricted SSH keys in combination with anaccess script.)
Cheat Sheet: http://ndpsoftware.com/git-cheatsheet.html
All configurations and customizations are located in∼/.gitconfig
![Page 187: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/187.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
>
echo ’hello 1’ > file1>
echo ’hello 2’ > file2
>
echo ’file2’ > .gitignore
>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1
hello 1
file2
hello 2
.gitignorefile2
![Page 188: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/188.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1
>
echo ’hello 2’ > file2
>
echo ’file2’ > .gitignore
>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1
hello 1
file2
hello 2
.gitignorefile2
![Page 189: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/189.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1>
echo ’hello 2’ > file2>
echo ’file2’ > .gitignore
>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2
hello 2
.gitignorefile2
![Page 190: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/190.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2
>
echo ’file2’ > .gitignore
>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2
hello 2
.gitignorefile2
![Page 191: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/191.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2>
echo ’file2’ > .gitignore>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 192: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/192.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore
>
git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 193: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/193.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore>
git init>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 194: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/194.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init
>
git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 195: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/195.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init>
git add .>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 196: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/196.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .
>
git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Index
file1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 197: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/197.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .>
git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Indexfile1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 198: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/198.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’
>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
Local Repository
1
Indexfile1 .giti*
Staging Area
file1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 199: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/199.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 200: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/200.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 201: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/201.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...
*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2
![Page 202: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/202.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2*.sw?
![Page 203: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/203.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...*.sw?
Ignore editor backup files
*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2*.sw?
![Page 204: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/204.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...*.sw?
Ignore editor backup files*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2*.sw?*∼
![Page 205: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/205.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...*.sw?
Ignore editor backup files*∼
Ignore OS generated files
.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2*.sw?*∼
![Page 206: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/206.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Ignoring (Temporary) Files or Directories
All files in .gitignore
will be ignored:
> echo ’hello 1’ > file1> echo ’hello 2’ > file2> echo ’file2’ > .gitignore> git init> git add .> git commit -m ’initial’>
Ignore with regex:
Ignore vim swap files, e.g.,file1.swp, file1.swo, file1...*.sw?
Ignore editor backup files*∼
Ignore OS generated files.DS STORE
Thumbs.db
master
Local Repository
1
Index
file1 .giti*
Staging Areafile1 .giti*
Workspace
file1hello 1
file2hello 2
.gitignorefile2*.sw?*∼.DS ST...Thumbs...
![Page 207: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/207.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands
Aliases to commands in ∼/.gitconfig, i.e.[alias]
st = statusco = commit
Aliases to functions (you can find these in my config)
git ls
List files under version controlgit tar
Create tar file from files under version controlgit commit-now (alias: ’cn’)
Commit with timestamp as messagegit commit-now-push (alias: ’cnp’)
Push after a commit-now
git tree
Show commit history as colored tree structure
![Page 208: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/208.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands
Aliases to commands in ∼/.gitconfig, i.e.[alias]
st = statusco = commit
Aliases to functions (you can find these in my config)
git ls
List files under version controlgit tar
Create tar file from files under version controlgit commit-now (alias: ’cn’)
Commit with timestamp as messagegit commit-now-push (alias: ’cnp’)
Push after a commit-now
git tree
Show commit history as colored tree structure
![Page 209: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/209.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands
Aliases to commands in ∼/.gitconfig, i.e.[alias]
st = statusco = commit
Aliases to functions (you can find these in my config)
git ls
List files under version controlgit tar
Create tar file from files under version controlgit commit-now (alias: ’cn’)
Commit with timestamp as messagegit commit-now-push (alias: ’cnp’)
Push after a commit-now
git tree
Show commit history as colored tree structure
![Page 210: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/210.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands
Aliases to commands in ∼/.gitconfig, i.e.[alias]
st = statusco = commit
Aliases to functions (you can find these in my config)
git ls
List files under version controlgit tar
Create tar file from files under version controlgit commit-now (alias: ’cn’)
Commit with timestamp as messagegit commit-now-push (alias: ’cnp’)
Push after a commit-now
git tree
Show commit history as colored tree structure
![Page 211: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/211.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 212: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/212.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 213: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/213.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 214: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/214.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 215: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/215.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 216: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/216.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git tree’ instead of ’git log’
![Page 217: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/217.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 218: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/218.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 219: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/219.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 220: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/220.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 221: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/221.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 222: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/222.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Create Custom Commands’git vimdiff’ instead of ’git diff’
![Page 223: Yet Another GIT Tutorialgdal/scripts/download.php?file=gittutorial.pdfYet Another GIT Tutorial by Giso H. Dal Introduction Architecture CVCS vs DVCS SVN vs GIT Commands Local Repository](https://reader030.fdocuments.us/reader030/viewer/2022040920/5e9840624a258f21df3742d6/html5/thumbnails/223.jpg)
Yet AnotherGIT Tutorial
by Giso H. Dal
Introduction
Architecture
CVCS vs DVCS
SVN vs GIT
Commands
Local Repository
Remote Repository
Workflow
Tips andTricks
Questions
Questions?
Email me atgdal at cs.ru.nl
for any further questions.