What? Why? How?
"Inspired" by
Noah `strum355` Santschi‑Cooney's slides
inspired by Colm `mloc` ó hIcí's slides inspired by Adam Gillessen's slidesCreated by Linus Torvalds in 2005
Git is a system in which developers can track changes in files in a timeline and can merge timelines to incorporate other developer's changes into their own timelines
Code is stored in Git as a collection called a repository.
Changes are represented by commits, which have an owner, message and set of changed files.
The default way is through the command line
There are a number of GUI tools built around the Git ecosystem and many editors have Git support built in
Downloads a copy of a remote repository including all history to your computer.
# Clone the repo
$ git clone https://github.com/UCCNetsoc/hacktoberfest.git
If you are working with GitHub you may want to clone your fork instead
$ git clone https://github.com/jac/hacktoberfest.git
Now that the repo is cloned, you can do whatever you want to the local files. Once we make some changes we can use `git status` to see what files have changed:
$ git status
On branch master
Untracked files:
(use "git add ..." to include in what will be committed)
sample.txt
`git status` will show you any files that have been added, changed, or removed
We can now use `git add` to choose the files we want to include in the commit
$ git add sample.txt
And then we use `git commit` to actually record the commit:
# allows setting the commit message in the quotes
$ git commit -m "big big ch-anges"
And finally, `git push` to upload the changes to the remote repository (GitHub, in this case)
GitHub is a more easily accessible interface and user experience for collaborating
Users can "fork" repositories, creating a copy/snapshot of a repository under the user's account
After making changes to this fork, users can create a "pull request" to request the changes be "pulled" into the main repository
If you're maintaining an open source project, 80%+ of your time will be spent reviewing other people's code
GitHub makes this relatively easy with pull requests
Reviewing a pull request demo!
More reading: