This document provides an introduction to Git and GitHub. It begins with an overview of source control and the history of version control systems like SVN and CVS. It then discusses key Git concepts like its three-tree architecture, branches and merging, and undoing changes. The document concludes with an introduction to GitHub, including how to clone repositories, collaborate through pull requests, and link a local Git repository to a remote GitHub repository.
This document provides an introduction to Git and GitHub. It begins with an overview of source control and the history of version control systems like SVN and CVS. It then discusses key concepts of Git like its three-tree architecture, branches and merging, and undoing changes. The document concludes with an introduction to GitHub, how to clone and collaborate on repositories, and some tips on reducing merge conflicts.
This document provides an introduction to Git and GitHub. It outlines the basics of Git including initializing repositories, tracking changes, branching, merging, and resolving conflicts. It also covers GitHub concepts such as cloning repositories from GitHub to a local machine and pushing/pulling changes between local and remote repositories. The document explains how to collaborate on projects hosted on GitHub using Git.
Git is a distributed version control system that allows developers to work collaboratively on projects. It works by creating snapshots of files in a project over time. Developers can commit changes locally and then push them to a remote repository to share with others. Key Git concepts include repositories, commits, branches, cloning repositories from remote locations, and commands like push, pull, commit, log and diff to manage changes.
Git is a version control system that allows users to synchronize branches and rewrite history. It stores project data in objects including blobs for file contents, trees for directories, commits for snapshots, and tags for references. Commits, branches, and tags are referenced by SHA-1 hashes or names. Rebasing replays commits onto another branch to keep a linear history, while merging uses commit objects to join branches. The reflog tracks reference updates and allows recovering from errors. Interactive rebasing edits the commit history. Bisecting helps identify the commit introducing a bug by binary searching the commit history.
GitHub is a web-based hosting service for version control using git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project
Git provide Distributed version control. Who is the user? Anyone want to truck hi note. Review history log changes. View difference between two versions.
The document discusses version control systems and Git. It provides an overview of centralized and distributed version control workflows. Key points include:
- Centralized VCSs involve committing changes to a central repository, while distributed VCSs allow users to commit locally and push changes.
- Git uses a distributed model where each user has a full local copy of the repository and commits changes locally before pushing.
- Common Git commands are add, commit, push, pull, status, diff, log, branch, tag, and remote for working with remote repositories.
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
Version control systems like Git allow developers to track changes to files over time. Git stores snapshots of files in a local repository and remote repositories can be used for collaboration. The basic Git workflow involves modifying files, staging changed files, and committing snapshots of the staged files to the local repository. Status and diff commands allow viewing changes between the working directory, staging area, and repository. Good commit messages are important for documenting changes over time.
This document provides an introduction to Git and GitHub. It begins with an overview of source control and the history of version control systems like SVN and CVS. It then discusses key concepts of Git like its three-tree architecture, branches and merging, and undoing changes. The document concludes with an introduction to GitHub, how to clone and collaborate on repositories, and some tips on reducing merge conflicts.
This document provides an introduction to Git and GitHub. It outlines the basics of Git including initializing repositories, tracking changes, branching, merging, and resolving conflicts. It also covers GitHub concepts such as cloning repositories from GitHub to a local machine and pushing/pulling changes between local and remote repositories. The document explains how to collaborate on projects hosted on GitHub using Git.
Git is a distributed version control system that allows developers to work collaboratively on projects. It works by creating snapshots of files in a project over time. Developers can commit changes locally and then push them to a remote repository to share with others. Key Git concepts include repositories, commits, branches, cloning repositories from remote locations, and commands like push, pull, commit, log and diff to manage changes.
Git is a version control system that allows users to synchronize branches and rewrite history. It stores project data in objects including blobs for file contents, trees for directories, commits for snapshots, and tags for references. Commits, branches, and tags are referenced by SHA-1 hashes or names. Rebasing replays commits onto another branch to keep a linear history, while merging uses commit objects to join branches. The reflog tracks reference updates and allows recovering from errors. Interactive rebasing edits the commit history. Bisecting helps identify the commit introducing a bug by binary searching the commit history.
GitHub is a web-based hosting service for version control using git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project
Git provide Distributed version control. Who is the user? Anyone want to truck hi note. Review history log changes. View difference between two versions.
The document discusses version control systems and Git. It provides an overview of centralized and distributed version control workflows. Key points include:
- Centralized VCSs involve committing changes to a central repository, while distributed VCSs allow users to commit locally and push changes.
- Git uses a distributed model where each user has a full local copy of the repository and commits changes locally before pushing.
- Common Git commands are add, commit, push, pull, status, diff, log, branch, tag, and remote for working with remote repositories.
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
Version control systems like Git allow developers to track changes to files over time. Git stores snapshots of files in a local repository and remote repositories can be used for collaboration. The basic Git workflow involves modifying files, staging changed files, and committing snapshots of the staged files to the local repository. Status and diff commands allow viewing changes between the working directory, staging area, and repository. Good commit messages are important for documenting changes over time.
These are slides of a GitHub training for the Roslyn team. The recording can be found here:
http://channel9.msdn.com/Blogs/dotnet/github-for-the-roslyn-team
This document provides an overview of advanced Git concepts, including:
- Git architecture with working copy, staging index, local repository, and remote repository
- Common Git commands like add, commit, push, pull, and their purposes
- Git configuration settings for user name, email, and formatting preferences
- Creating and cloning repositories locally and remotely
- Using branches to work on features independently and merging them together
- Tracking other developers' repositories as remotes to collaborate on work
This document provides an introduction and overview of Git. It begins with a brief history of Git's origins with Linux source code management. It then covers key Git concepts like its distributed version control model, advantages like speed and resilience, and some basic commands. The document demonstrates setting up a sample Git repository and making commits. It also discusses branching, tagging, undoing changes, cleaning up repositories, and using remote repositories.
This document provides an overview of Git, a distributed version control system. It discusses Git's history, getting started, the three trees that make up a Git repository (HEAD, index, working directory), centralized vs distributed version control systems, basic workflows, branching and merging, and keeping workflows simple. Key points include that Git was created by Linus Torvalds for Linux kernel development, supports concurrent work and merging changes from multiple developers, and uses a commit graph and branching model to manage project versions.
Git is a free and open source distributed version control system designed by Linus Torvalds in 2005 to handle everything from small to large projects with speed and efficiency. It allows for tracking changes to code, collaborative work, and reverting to previous versions of code. GitHub is a site for hosting Git repositories online that adds features like documentation, bug tracking, and code review via pull requests. Common Git commands include git init to initialize a repository, git add to stage changes, git commit to save changes to the project history, and git push to upload changes to a remote repository.
The document provides a brief history of revision control systems including SCCS, RCS, CVS, Subversion, and distributed systems like Git, Mercurial, and Bazaar. It discusses the problems with earlier systems that motivated the creation of Git, including issues with CVS and Subversion. It describes how Linus Torvalds created Git to address these problems and support fast, distributed, and non-linear development workflows.
Git is a version control system created by Linus Torvalds in 2005 for tracking changes in source code over time. It allows for non-linear development through features like branching and distributed collaboration. The document provides an overview of common Git concepts and commands including initializing and cloning repositories, tracking file changes, committing snapshots of changes to the local repository, and interacting with remote repositories by pushing and pulling changes. Best practices for Git include not pushing directly to master, defining code owners, avoiding secrets and dependencies in commits, and maintaining a meaningful .gitignore file.
In one of our weekly training, we’ve talked about Git. Here is a quick overview of the main concepts, basic commands and branching strategy, how to work with Git, how to contribute to an OSS project, …
Git is a distributed version control system that allows users to track changes to files and collaborate with others. It maintains a database of snapshots of files and allows users to commit changes, compare changes between versions, and collaborate through a remote server. Some key aspects of Git include its use of snapshots rather than file differences, its local operations that add data, and its three stages of files - the working directory, staging area, and Git directory.
[2015/2016] Collaborative software development with GitIvano Malavolta
This presentation is about a lecture I gave within the "Software systems and services" immigration course at the Gran Sasso Science Institute, L'Aquila (Italy): http://cs.gssi.infn.it/.
http://www.ivanomalavolta.com
A Beginner's Guide to Git and GitHub, CLI version.
What is Git?
What is Github
Basic commands
Difference between Central and Distributed Version Controlling System
Git is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Git is a distributed version control system that allows developers to work on projects locally before pushing changes to remote repositories. It uses snapshots of file changes and checksums rather than file version numbers to track file history. The basic Git workflow involves modifying files locally, staging changes, and committing snapshots of the staged changes to the local repository. Changes can then be pulled from and pushed to remote repositories like GitHub.
Git is a version control system that tracks changes to files. It maintains a graph of commits where each commit is a node. The key concepts covered are Git references, the file status lifecycle between the working directory, staging area and Git directory, and common commands like add, commit, log and status. Branching allows independent lines of development and fast-forward merging can linearly integrate feature branches. Tags mark important points in history. The --amend flag replaces the most recent commit. Remote branches exist on remote servers while local branches are only visible locally.
Git is a version control system that stores snapshots of files rather than tracking changes between file versions. It allows for offline work and nearly all operations are performed locally. Files can exist in three states - committed, modified, or staged. Commits create snapshots of the staged files. Branches act as pointers to commits, with the default branch being master.
Git is a distributed version control system that allows for collaborative development of software. GitHub is a hosting service for Git repositories that provides a web interface and additional features. The document provides step-by-step instructions for installing Git, configuring it with GitHub, working locally and remotely with repositories, and additional resources for learning more about Git and GitHub.
Thymeleaf is a Java template engine that can be used as a view technology in Spring applications. It integrates well with Spring and allows templates to be defined using HTML/XML syntax with additional Thymeleaf attributes and expressions. Templates can include static elements as well as dynamic content through standard dialect expressions. Templates can also be extended and customized through additional dialects. Thymeleaf provides advantages such as support for multiple template modes, internationalization, caching, and extensibility, though it can be slower than some other template engines.
These are slides of a GitHub training for the Roslyn team. The recording can be found here:
http://channel9.msdn.com/Blogs/dotnet/github-for-the-roslyn-team
This document provides an overview of advanced Git concepts, including:
- Git architecture with working copy, staging index, local repository, and remote repository
- Common Git commands like add, commit, push, pull, and their purposes
- Git configuration settings for user name, email, and formatting preferences
- Creating and cloning repositories locally and remotely
- Using branches to work on features independently and merging them together
- Tracking other developers' repositories as remotes to collaborate on work
This document provides an introduction and overview of Git. It begins with a brief history of Git's origins with Linux source code management. It then covers key Git concepts like its distributed version control model, advantages like speed and resilience, and some basic commands. The document demonstrates setting up a sample Git repository and making commits. It also discusses branching, tagging, undoing changes, cleaning up repositories, and using remote repositories.
This document provides an overview of Git, a distributed version control system. It discusses Git's history, getting started, the three trees that make up a Git repository (HEAD, index, working directory), centralized vs distributed version control systems, basic workflows, branching and merging, and keeping workflows simple. Key points include that Git was created by Linus Torvalds for Linux kernel development, supports concurrent work and merging changes from multiple developers, and uses a commit graph and branching model to manage project versions.
Git is a free and open source distributed version control system designed by Linus Torvalds in 2005 to handle everything from small to large projects with speed and efficiency. It allows for tracking changes to code, collaborative work, and reverting to previous versions of code. GitHub is a site for hosting Git repositories online that adds features like documentation, bug tracking, and code review via pull requests. Common Git commands include git init to initialize a repository, git add to stage changes, git commit to save changes to the project history, and git push to upload changes to a remote repository.
The document provides a brief history of revision control systems including SCCS, RCS, CVS, Subversion, and distributed systems like Git, Mercurial, and Bazaar. It discusses the problems with earlier systems that motivated the creation of Git, including issues with CVS and Subversion. It describes how Linus Torvalds created Git to address these problems and support fast, distributed, and non-linear development workflows.
Git is a version control system created by Linus Torvalds in 2005 for tracking changes in source code over time. It allows for non-linear development through features like branching and distributed collaboration. The document provides an overview of common Git concepts and commands including initializing and cloning repositories, tracking file changes, committing snapshots of changes to the local repository, and interacting with remote repositories by pushing and pulling changes. Best practices for Git include not pushing directly to master, defining code owners, avoiding secrets and dependencies in commits, and maintaining a meaningful .gitignore file.
In one of our weekly training, we’ve talked about Git. Here is a quick overview of the main concepts, basic commands and branching strategy, how to work with Git, how to contribute to an OSS project, …
Git is a distributed version control system that allows users to track changes to files and collaborate with others. It maintains a database of snapshots of files and allows users to commit changes, compare changes between versions, and collaborate through a remote server. Some key aspects of Git include its use of snapshots rather than file differences, its local operations that add data, and its three stages of files - the working directory, staging area, and Git directory.
[2015/2016] Collaborative software development with GitIvano Malavolta
This presentation is about a lecture I gave within the "Software systems and services" immigration course at the Gran Sasso Science Institute, L'Aquila (Italy): http://cs.gssi.infn.it/.
http://www.ivanomalavolta.com
A Beginner's Guide to Git and GitHub, CLI version.
What is Git?
What is Github
Basic commands
Difference between Central and Distributed Version Controlling System
Git is a distributed version control system: tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
Git is a distributed version control system that allows developers to work on projects locally before pushing changes to remote repositories. It uses snapshots of file changes and checksums rather than file version numbers to track file history. The basic Git workflow involves modifying files locally, staging changes, and committing snapshots of the staged changes to the local repository. Changes can then be pulled from and pushed to remote repositories like GitHub.
Git is a version control system that tracks changes to files. It maintains a graph of commits where each commit is a node. The key concepts covered are Git references, the file status lifecycle between the working directory, staging area and Git directory, and common commands like add, commit, log and status. Branching allows independent lines of development and fast-forward merging can linearly integrate feature branches. Tags mark important points in history. The --amend flag replaces the most recent commit. Remote branches exist on remote servers while local branches are only visible locally.
Git is a version control system that stores snapshots of files rather than tracking changes between file versions. It allows for offline work and nearly all operations are performed locally. Files can exist in three states - committed, modified, or staged. Commits create snapshots of the staged files. Branches act as pointers to commits, with the default branch being master.
Git is a distributed version control system that allows for collaborative development of software. GitHub is a hosting service for Git repositories that provides a web interface and additional features. The document provides step-by-step instructions for installing Git, configuring it with GitHub, working locally and remotely with repositories, and additional resources for learning more about Git and GitHub.
Thymeleaf is a Java template engine that can be used as a view technology in Spring applications. It integrates well with Spring and allows templates to be defined using HTML/XML syntax with additional Thymeleaf attributes and expressions. Templates can include static elements as well as dynamic content through standard dialect expressions. Templates can also be extended and customized through additional dialects. Thymeleaf provides advantages such as support for multiple template modes, internationalization, caching, and extensibility, though it can be slower than some other template engines.
The document introduces iBatis as an alternative to Hibernate for reducing the complexity of mapping Java objects to database tables without using JDBC code directly, as iBatis uses XML configuration files to define SQL statements and maps data between objects and database rows similarly to Hibernate but without being an full ORM solution. IBatis provides simpler configuration than Hibernate through SQL mapping files that define queries to retrieve and save Java objects without mixing Java and SQL code directly in the application.
The document provides an overview of Spring concepts including annotations, MVC, dependency injection, bean management, and unit testing. It also covers Spring modules, inversion of control, bean scopes, wiring beans, Spring MVC, form validation, pre-populating models, and Spring Security. Code examples demonstrate CRUD operations using Spring, Hibernate and MySQL as well as Spring Security configuration. The document concludes with exercises on bean scopes and annotations.
The document provides an overview of new features in Java 8 including lambda expressions, functional interfaces, default and static interface methods, method references, stream API, and date/time API. Lambda expressions allow for anonymous functions and functional interfaces provide functional signatures. Default and static interface methods allow interfaces to define implementations. Method references provide shorthand syntax for lambda expressions. The stream API supports functional-style processing of collections through intermediate and terminal operations. The new date/time API replaces the Calendar class with more easily used and immutable classes like LocalDate.
A375 Example Taste the taste of the Lord, the taste of the Lord The taste of...franktsao4
It seems that current missionary work requires spending a lot of money, preparing a lot of materials, and traveling to far away places, so that it feels like missionary work. But what was the result they brought back? It's just a lot of photos of activities, fun eating, drinking and some playing games. And then we have to do the same thing next year, never ending. The church once mentioned that a certain missionary would go to the field where she used to work before the end of his life. It seemed that if she had not gone, no one would be willing to go. The reason why these missionary work is so difficult is that no one obeys God’s words, and the Bible is not the main content during missionary work, because in the eyes of those who do not obey God’s words, the Bible is just words and cannot be connected with life, so Reading out God's words is boring because it doesn't have any life experience, so it cannot be connected with human life. I will give a few examples in the hope that this situation can be changed. A375
Sanatan Vastu | Experience Great Living | Vastu ExpertSanatan Vastu
Santan Vastu Provides Vedic astrology courses & Vastu remedies, If you are searching Vastu for home, Vastu for kitchen, Vastu for house, Vastu for Office & Factory. Best Vastu in Bahadurgarh. Best Vastu in Delhi NCR
The Book of Ruth is included in the third division, or the Writings, of the Hebrew Bible. In most Christian canons it is treated as one of the historical books and placed between Judges and 1 Samuel.
The forces involved in this witchcraft spell will re-establish the loving bond between you and help to build a strong, loving relationship from which to start anew. Despite any previous hardships or problems, the spell work will re-establish the strong bonds of friendship and love upon which the marriage and relationship originated. Have faith, these stop divorce and stop separation spells are extremely powerful and will reconnect you and your partner in a strong and harmonious relationship.
My ritual will not only stop separation and divorce, but rebuild a strong bond between you and your partner that is based on truth, honesty, and unconditional love. For an even stronger effect, you may want to consider using the Eternal Love Bond spell to ensure your relationship and love will last through all tests of time. If you have not yet determined if your partner is considering separation or divorce, but are aware of rifts in the relationship, try the Love Spells to remove problems in a relationship or marriage. Keep in mind that all my love spells are 100% customized and that you'll only need 1 spell to address all problems/wishes.
Save your marriage from divorce & make your relationship stronger using anti divorce spells to make him or her fall back in love with you. End your marriage if you are no longer in love with your husband or wife. Permanently end your marriage using divorce spells that work fast. Protect your marriage from divorce using love spells to boost commitment, love & bind your hearts together for a stronger marriage that will last. Get your ex lover who has remarried using divorce spells to break up a couple & make your ex lost lover come back to you permanently.
Visit https://www.profbalaj.com/love-spells-loves-spells-that-work/
Call/WhatsApp +27836633417 for more info.
The Hope of Salvation - Jude 1:24-25 - MessageCole Hartman
Jude gives us hope at the end of a dark letter. In a dark world like today, we need the light of Christ to shine brighter and brighter. Jude shows us where to fix our focus so we can be filled with God's goodness and glory. Join us to explore this incredible passage.
A Free eBook ~ Valuable LIFE Lessons to Learn ( 5 Sets of Presentations)...OH TEIK BIN
A free eBook comprising 5 sets of PowerPoint presentations of meaningful stories /Inspirational pieces that teach important Dhamma/Life lessons. For reflection and practice to develop the mind to grow in love, compassion and wisdom. The texts are in English and Chinese.
My other free eBooks can be obtained from the following Links:
https://www.slideshare.net/ohteikbin/presentations
https://www.slideshare.net/ohteikbin/documents
The Enchantment and Shadows_ Unveiling the Mysteries of Magic and Black Magic...Phoenix O
This manual will guide you through basic skills and tasks to help you get started with various aspects of Magic. Each section is designed to be easy to follow, with step-by-step instructions.
2. Outline
I. Introductionto source control
A. History and fundamental concepts behind source control
B. Centralized vs. distributed version control
II. Introductionto Git
A. What is Git? Basic Git concepts and architecture
B. Git workflows: Creating a new repo (adding, committing code)
C. HEAD
D. Git commands (checking out code)
E. Master vs branch concept
F.Creating a branch/switching between branches
G. Merging branches and resolving conflicts
III. Introductionto GitHub
A. What is GitHub? Basic GitHub concepts
B. GitHub in practice: Distributed version control
C. Cloning a remote repo
D. Fetching/Pushing to a remote repo
E. Collaborating using Git and GitHub
3. What is a ‘version control system?’
• a way to manage files and directories
• track changes over time
• recall previous versions
• ‘source control’ is a subset of a VCS.
4. Some history of source control…
(1972) Source Code Control System (SCCS)
- closed source, part of UNIX
(1982) Revision Control System(RCS)
- open source
(1986) Concurrent Versions System (CVS)
- open source
(2000) Apache Subversion (SVN)
- open source
5. …more history
(2000) BitKeeper SCM
- closed source, proprietary, used with
source code management of Linux kernel
- free until 2005
- distributed version control
6. Distributed version control
No central server
Every developer is a client, the server and the repository
Source: http://bit.ly/1SH4E23
8. What is git?
• created by Linus Torvalds, April 2005
• replacement for BitKeeper to manage Linux kernel changes
• a command line version control program
• uses checksums to ensure data integrity
• distributed version control (like BitKeeper)
• cross-platform (including Windows!)
• open source, free
10. Git distributed version control
• “If you’re not distributed, you’re not worth using.” – Linus Torvalds
• no need to connect to central server
• can work without internet connection
• no single failure point
• developers can work independently and merge their work later
• every copy of a Git repository can serve either as the server or as a client
(and has complete history!)
• Git tracks changes, not versions
• Bunch of little change sets floating around
11. Is Git for me?
• People primarily working with source code
• Anyone wanting to track edits (especially changes
to text files)
- review history of changes
- anyone wanting to share, merge changes
• Anyone not afraid of
command line tools
12. Most popular languages used with Git
• HTML
• CSS
• Javascript
• Python
• ASP
• Scala
• Shell scripts
• PHP
• Ruby
• Ruby on Rails
• Perl
• Java
• C
• C++
• C#
• Objective C
• Haskell
• CoffeeScript
• ActionScript
Not as useful for image, movies,
music…and files that must be
interpreted (.pdf, .psd, etc.)
14. Git install tip
• Much better to set up on a per-user basis
(instead of a global, system-wide install)
15. What is a repository?
• “repo” = repository
• usually used to organize a single project
• repos can contain folders and files, images,
videos, spreadsheets, and data sets – anything
your project needs
17. Git uses a three-tree architecture
Staging index
working
Repository
checkout
add
commit
18. A simple Git workflow
1. Initialize a new project in a directory:
git init
2. Add a file using a text editor to the directory
3. Add every change that has been made to the directory:
git add .
4. Commit the change to the repo:
git commit –m “important message here”
.
19. After initializing a new git repo…
3. Commit changes with
a message
2. Add changes
1. Make changes
Staging index
working
Repository
add
commit
20. A note about commit messages
• Tell what it does (present tense)
• Single line summary followed by blank space
followed by more complete description
• Keep lines to <= 72 characters
• Ticket or bug number helps
21. Good and bad examples
Bad: “Typo fix”
Good: “Add missing / in CSS section”
Bad: “Updates the table. We’ll discuss next
Monday with Darrell.”
25. The HEAD pointer
• points to a specific commit in repo
• as new commits are made, the pointer
changes
• HEAD always points to the “tip” of the
currently checked-out branch in the repo
• (not the working directory or staging index)
• last state of repo (what was checked out initially)
• HEAD points to parent of next commit (where writing the next commit
takes place)
26. Y4f7uiPRRo… Pu87rRi4DD.. Qs2o0k64ja… i7Ewd37kL9…
HEAD
Parent of
Parent of
Parent of
Last commit
9i5Tyh67dg.. oe48Hr3Gh9.. d3Ui94Hje4...
master
branch
27. Which files were changed and where
do they sit in the three tree?
git status – allows one to see where files are in
the three tree scheme
Staging
index
working
Repository
add
commit
28. What changed in working directory?
git diff – compares changes to files between
repo and working directory
Note: git diff --staged - compares staging index to repo
Note: git diff filename can be used as well
Staging
index
working
Repository
add
commit
Line numbers in file
Removed
Added
29. Deleting files from the repo
git rm filename.txt
• moves deleted file change to staging
area
• It is not enough to delete the file in
your working directory. You must
commit the change.
Staging
index
working
Repository
add
commit
31. Moving (renaming) files
git mv filename1.txt filename2.txt
Note: File file1.txt was committed to repo earlier.
Staging
index
working
Repository
add
commit
32. Good news!
git init
git status
git log
git add
git commit
git diff
git rm
git mv
75% of the time you’ll be using
only these commands
33. What if I want to undo changes made
to working directory?
git checkout something
(where “something” is a file or an entire branch)
• git checkout will grab the
file from the repo
• Example: git checkout -- file1.txt
(“checkout file ‘file1.txt’ from the current branch”)
Staging
index
working
Repository
checkout
34. What if I want to undo changes added
to staging area?
git reset HEAD filename.txt
Staging
index
working
Repository
add
commit
35. What if I want to undo changes
committed to the repo?
Staging
index
working
Repository
add
commit
git commit --amend -m “message”
• allows one to amend a change to the last
commit
• anything in staging area will be amended
to the last commit
36. Y4f7uiPRRo… Pu87rRi4DD.. Qs2o0k64ja… i7Ewd37kL9…
HEAD
Parent of
Parent of
Parent of
master
Note: To undo changes to older commits, make a new commit
Added ‘apple’ Added ‘plum’ Added ‘apple’
37. Obtain older versions
git checkout 6e073c640928b -- filename.txt
Note: Checking out older commits places them into the
staging area
Staging
index
working
Repository
add
commit
39. Which files are in a repo?
git ls-tree tree-ish
tree-ish – a way to reference a repo
full SHA, part SHA, HEAD, others
blob = file, tree = directory
40. branching
• allows one to try new ideas
• If an idea doesn’t work, throw away the branch.
Don’t have to undo many changes to master
branch
• If it does work, merge ideas into master branch.
• There is only one working directory
41. Branching and merging example
master
new branch
h4Rt5uEl9p Ge8r67elOp
Y4f7uiPRRo Pu87rRi4DD Qs2o0k64ja i7Ewd37kL9 he8o9iKlreD kle987yYieo mN34i4uwQ
SHA = a commit
HEAD changes from new
branch merged into
master
HEAD
45. How do I create a new branch?
git branch new_branch_name
Note: At this point, both HEADs of the branches are pointing to the same
commit (that of master)
46. How do I switch to new branch?
git checkout new_branch_name
At this point, one can switch between branches, making commits, etc. in either
branch, while the two stay separate from one another.
Note: In order to switch to another branch, your current working directory
must be clean (no conflicts, resulting in data loss).
48. How do I merge a branch?
From the branch into which you want to merge another
branch….
git merge branch_to_merge
Note: Always have a clean working directory when merging
49. “fast-forward” merge occurs when HEAD of master
branch is seen when looking back
Y4f7uiPRRo Pu87rRi4DD Qs2o0k64ja i7Ewd37kL9
h4Rt5uEl9p
HEAD
h4Rt5uEl9p Ge8r67elOp
Y4f7uiPRRo Pu87rRi4DD Qs2o0k64ja i7Ewd37kL9 he8o9iKlreD kle987yYieo mN34i4uwQ
HEAD
HEAD
HEAD
master
new_branch
“recursive” merge occurs by looking back and combining
ancestors to resolve merge
HEAD
50. merge conflicts
What if there are two changes to same line in two
different commits?
file1.txt file1.txt
apple
master new_feature
banana
51. Resolving merge conflicts
Git will notate the conflict in the files!
Solutions:
1. Abort the merge using git merge –abort
2. Manually fix the conflict
3. Use a merge tool (there are many out there)
56. GitHub
• a platform to host git code repositories
• http://github.com
• launched in 2008
• most popular Git host
• allows users to collaborate on projects from anywhere
• GitHub makes git social!
• Free to start
58. Important to remember
Sometimes developers choose to place repo on
GitHub as a centralized place where everyone
commits changes, but it doesn’t have to be on
GitHub
63. How do I link my local repo to a remote repo?
git remote add <alias> <URL>
Note: This just establishes a connection…no files are copied/moved
Note: Yes! You may have more than one remote linked to your local
directory!
Which remotes am I linked to?
git remote
64. Pushing to a remote repo
git push local_branch_alias branch_name
65. Fetching from a remote repo
git fetch remote_repo_name
Fetch in no way changes a your working dir or any
commits that you’ve made.
• Fetch before you work
• Fetch before you push
• Fetch often
git merge must be done to merge fetched changes into
local branch
67. Collaborating with Git
Email sent along with link; collaborator has read/write access.
Everyone has read access
If you want write access and you haven’t been invited, “fork” the
repo
70. Good resources
• Git from Git: https://git-scm.com/book/en/v2
• A guided tour that walks through the fundamentals of Git:
https://githowto.com
• Linus Torvalds on Git:
https://www.youtube.com/watch?v=idLyobOhtO4
• Git tutorial from Atlassian:
https://www.atlassian.com/git/tutorials/
• A number of easy-to-understand guides by the GitHub folks
https://guides.github.com
71. git commit -a
• Allows one to add to staging index and
commit at the same time
• Grabs everything in working direcotry
• Files not tracked or being deleted are not
included
72. git log --oneline
• gets first line and checksum of all commits in
current branch
73. git diff g5iU0oPe7x
When using checksum of older commit, will
show you all changes compared to those in
your working directory
74. Renaming and deleting branches
git branch –m/--move old_name new_name
git branch –d branch_name
Note: Must not be in branch_name
Note: Must not have commits in branch_name unmerged in
branch from which you are deleting
git branch –D branch_name
Note: If you are *really* sure that you want to delete branch
with commits
75. Tagging
• Git has the ability to tag specific points in history
as being important, such as releases versions
(v.1.0, 2.0, …)
git tag
76. Tagging
Two types of tags:
lightweight – a pointer to a specific comment –
basically a SHA stored in a file
git tag tag_name
annotated – a full object stored in the Git database –
SHA, tagger name, email, date, message
and can be signed and verified with GNU
Privacy Guard (GPG)
git tag –a tag_name –m “message”