Introduction to Git
|
Version control is like an unlimited ‘undo’.
Version control also allows many people to work in parallel.
git init initializes a repository.
Git stores all of its repository data in the .git directory.
git status shows the status of a repository.
Files can be stored in a project’s working directory (which users see), the staging area (where the next commit is being built up) and the local repository (where commits are permanently recorded).
git add puts files in the staging area.
git commit saves the staged content as a new commit in the local repository.
|
Collaborating
|
|
Conflicts
|
Conflicts occur when two or more people change the same lines of the same file.
The version control system does not allow people to overwrite each other’s changes blindly, but highlights conflicts so that they can be resolved.
|
Branches
|
git branch creates a branch.
git checkout allows you to switch between branches
git merge to merge branches
|
Forks and Pull Requests
|
Any public repository on GitHub can be forked and modified.
If you make changes to a forked repository, you can request that the maintainer of the original repository merges your changes into theirs.
|
Integrate Matlab and Git
|
|
Resources to learn more
|
|