Revision Control and git Flashcards
Introduction:
- Sometimes called _______ ______ ______ (VCS)
- _____ of any good software development
- Typically keeps track of _______ (deltas) of files
- Files are checked in and checked out from a ______
- Sometimes called version control system (VCS)
- Basis of any good software development
- Typically keeps track of differences (deltas) of files
- Files are checked in and checked out from a repository
Simple:
$ mkdir RCS
$ ci -l lorem.1
RCS/lorem.1,v <– lorem.1
enter description, terminated with single ‘.’ or end of file:
NOTE: This is NOT the log message!
>> .
initial revision: 1.1
done
$ vi lorem.1
$ mkdir RCS
$ ci -l lorem.1
RCS/lorem.1,v <– lorem.1
enter description, terminated with single ‘.’ or end of file:
NOTE: This is NOT the log message!
>> .
initial revision: 1.1
done
$ vi lorem.1
What To Do:
- Every time you have something running, ____ it in
- Every time before you make a significant ______, check it in
- Every ____ ____ or so, check it in
- Now you’ll know what you _____
- Every time you have something running, check it in
- Every time before you make a significant change, check it in
- Every half hour or so, check it in
- Now you’ll know what you broke
History – Local Store:
•____ ____ ______ _______
–SCCS
–Early: 1972
–Store first version and then all deltas
•________ _________ _________
–More functionality than SCCS
–Store most recent and then deltas to go ______
•
•Source Code Control System
–SCCS
–Early: 1972
–Store first version and then all deltas
•Revision Control System
–More functionality than SCCS
–Store most recent and then deltas to go backwards
•
History – Client/Server:
•_______ users have access
–Either file _______ or merging of diffs
•_________ _________ _________
–Originally built on top of RCS
•_________
–Inspired by CVS
•Multiple users have access
–Either file locking or merging of diffs
•Concurrent Version System
–Originally built on top of RCS
•Subversion
–Inspired by CVS
Commercial:
IBM® ClearCase® is an enterprise-grade __________ _____________ __________ that provides highly secure version ________with work and build __________ support..
IBM® ClearCase® is an enterprise-grade configuration management system that provides highly secure version control with work and build management support.
Commercial:
Perforce is a commercial, proprietary ______ ______ ________- developed by Perforce Software.
Perforce is a commercial, proprietary revision control system developed by Perforce Software.
Commercial:
Microsoft Visual SourceSafe (VSS) is a discontinued source _______ _________, oriented towards small software development projects. Like most source control systems, SourceSafe creates avirtual library of computer files. While most commonly used for source code, SourceSafe can handle any type of file in its database, but older versions were shown[1][2] to be unstable when used to store large amounts of non-textual data such as images, and compiled executables.
Microsoft Visual SourceSafe (VSS) is a discontinued source control program, oriented towards small software development projects. Like most source control systems, SourceSafe creates avirtual library of computer files. While most commonly used for source code, SourceSafe can handle any type of file in its database, but older versions were shown[1][2] to be unstable when used to store large amounts of non-textual data such as images, and compiled executables.
Distributed/P2P:
•Mercurial:
Mercurial is a free, distributed ________ _______ ____________ tool. It efficiently handles _______ of any size and offers an easy and intuitive interface.
Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.
Distributed/P2P:
Git is a widely-used _____ ___ ________ system for software development. It is a distributed revision control system with an emphasis on _____, ___ integrity,[7] and support for distributed, non-linear workflows.[8] Git was initially designed and developed in 2005 by Linux kerneldevelopers (including Linus Torvalds) for Linux kernel development.
Git (/ɡɪt/[5]) is a widely-used source code management system for software development. It is a distributed revision control system with an emphasis on speed,[6] data integrity,[7] and support for distributed, non-linear workflows.[8] Git was initially designed and developed in 2005 by Linux kerneldevelopers (including Linus Torvalds) for Linux kernel development.
Branches, Merges, Tags:
Git It?
- Sourceforge and CVS ______ very popular for open-source projects.
- Git and GitHub becoming very popular
–GitHub site written in ___
•Git attempts to keep most operations local
–Faster
–Works when _________
- Sourceforge and CVS initially very popular for open-source projects.
- Git and GitHub becoming very popular
–GitHub site written in RoR
•Git attempts to keep most operations local
–Faster
–Works when disconnected
Continued:
- Git based on _______, not deltas
- Every check in creates a “new” set of files
–If a files hasn’t been changed, just a link to existing file
•”Like a mini filesystem”
- Git based on snapshots, not deltas
- Every check in creates a “___” set of files
–If a files hasn’t been changed, just a link to existing file
•”Like a ___ _______”
Traditional Versioning:
Snapshot:
Three States:
•Committed
–In the local _______
•________
–Changed from the _______ in the local _________
•Staged
–Ready to _________
•Committed
–In the local database
•Modified
–Changed from the version in the local database
•Staged
–Ready to commit
Three States
More
- If there is a preexisting ______, one can ______ it
- Status will tell you which______ you are on and the files you’ve changed
–”master”
•”git rm”, “git mv”, “git log”
- If there is a preexisting repository, one can clone it
- Status will tell you which branch you are on and the files you’ve changed
–”master”
•”git rm”, “git mv”, “git log”
Remote:
- “git remote”
- “git remote add”
- “git push”
–Send your ______
•”git fetch”
–Get other people’s ______
•“git pull”
–Get other people’s changes and merge
- “git remote”
- “git remote add”
- “git push”
–Send your changes
•”git fetch”
–Get other people’s changes
•“git pull”
–Get other people’s changes and merge
Tags:
•”git tag”
–Often used for release versions
•”git tag”
–Often used for release versions
Branching, Initially:
git branch testing
Switching
git checkout testing:
Commands:
$ git branch _____
$ git checkout ______
Switched to ______ ‘testing’
$ git status
On branch testing
nothing to commit, working ______ clean
$ git branch testing
$ git checkout testing
Switched to branch‘testing’
$ git status
On branch testing
nothing to commit, working directory clean
Work on Branch
$ git status
On branch testing
Changes not ______ for commit:
(use “git add <file>..." to update what will be committed)</file>
(use “git checkout – <file>..." to discard changes in working directory)</file>
modified: lorem.1
no changes added to commit (use “git add” and/or “git commit -a”)
$ git commit -a -m ‘done testing’
[testing 40ebc5f] done testing
1 file changed, 1 insertion(+), 1 deletion(-)
$ git status
On branch testing
Changes not staged for commit:
(use “git add <file>..." to update what will be committed)</file>
(use “git checkout – <file>..." to discard changes in working directory)</file>
modified: lorem.1
no changes added to commit (use “git add” and/or “git commit -a”)
$ git commit -a -m ‘done testing’
[testing 40ebc5f] done testing
1 file changed, 1 insertion(+), 1 deletion(-)
Merge:
$ git checkout _____
Switched to branch ‘master’
$ git merge testing
Updating 02dd1d8..40ebc5f
Fast-forward
lorem.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
$ git status
On branch master
nothing to commit, working directory clean
$ git branch -d testing
Deleted branch ______ (was 40ebc5f).
$ git checkout master
Switched to branch ‘master’
$ git merge testing
Updating 02dd1d8..40ebc5f
Fast-forward
lorem.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
$ git status
On branch master
nothing to commit, working directory clean
$ git branch -d testing
Deleted branch testing (was 40ebc5f).