Catya Temkin
In this lecture, we discussed Version Control Systems and useful related git commands. I will go more in depth with Centralized Systems versus Distributed Systems along with their pros and cons.
- Simplify maintaining code
- There is one unified history
- everyone has to agree on avalible versions
- clients just have a set of "working" files
- to commit changes, client must reconnect to the main server
- Pros:
- Possible to look at past versions
- Simplicity of a single server
- Cons:
- Single server may go offline
- Must be connected to server to commit (need access to internet)
- Shared history
- Clients make a copy of the systems history when checking out code
- Clients check in/commits to their personal history
- Pros:
- No need for internet to commit
- No problem if server goes offline
- Cons:
- Redundancy (multiple copies of history)
- Potential for disagreement
- need way to resolve conflicts and share histories
- Git is a distributed verson control system
- track the changes (delta)
- can use tools called diff and patch
- snapshots are full copies of changed files
- unchanged files are pointers to the previous version
- Git uses snapshots
- The Git workspace has 3 different states/loactions
- Working directory
- Staging
- Repository (history)
- Useful and related Git commands
status
view current statuslog
sequence and information of past commitsadd
move from working directory to stagedrestore --staged
move from staged back to working directorygit commit
move from staged to repositoryreset --soft HEAD^
undo commitcheckout
move from repository to working directory