Tomas Petricek
email: t.petricek@kent.ac.uk
twitter: @tomaspetricek
office: S129A
Source control
Collaborative development
Git and source control
Version and history tracking systems
Keep version history because you will need to look back
Develop features independently and merge changes
Graphical user interface
Command line tools
git
commandGitHub and collaboration
Help teams plan and collaborate and organize
Manage issues, notes, plans, contributions
Also a "social network"
for open source software
GitHub as a CV
Use your GitHub profile to show your work!
Great if you are looking for your first job
Valid criticism of the GitHub as a CV idea
Everything in one folder
.git
folder with old versions etc..gitignore
and other special filesVersioning and collaboration
Working directory
Files you directly edit
Staging area
Selection to be archived
Local repository
History and versions
Remote repositories
Versions on other computer(s)
Initialize empty repository in current folder
1: 2: |
|
1: 2: 3: 4: |
|
Create new version history record (commit)
1: 2: 3: 4: |
|
1: 2: 3: 4: 5: |
|
Warning: This slide contains profanities
How to write a good commit message?
Brief summary of the change (70 characters)
Add more detailed comment after a newline
Use branches for different versions and features
Branch is named pointer to a commit
Master branch is typically the "main" once
Branch for each version running in production
Directed acyclic graph
Commits identified by hash
Arrow to a previous state
Directed acyclic graph
Commits identified by hash
Arrow to a previous state
Commits, branches, head
Branch is a pointer to commit
Current branch identified as HEAD
Directed acyclic graph
Commits identified by hash
Arrow to a previous state
Commits, branches, head
Branch is a pointer to commit
Current branch identified as HEAD
Merging changes from branches
Commit with multiple parents
Potential for conflicts
Create and switch head to a new branch
1: 2: 3: |
|
1: 2: 3: |
|
List branches and switch to master
1: 2: 3: |
|
1: 2: 3: 4: 5: 6: |
|
Uses distributed model with no central server
There are user interface tools for using git
Git is way more complex than it seems
Alternatives include Subversion, Mercurial, Perforce
Software engineering today
From "we know where we want to get"
To "know we continue moving in the right direction"
Using git for version and history tracking
Working dir, staging area, local and remote repositories
Creating, commits, working with branches, merging
What you should remember from this lecture
Tomas Petricek
t.petricek@kent.ac.uk | @tomaspetricek