The concept of version control is quite simple and we all have different systems and ways of doing it:
Source: http://phdcomics.com/comics/archive_print.php?comicid=1531
Source: https://www.datamation.com/news/tech-comics-version-control-1.html
Source: McTavish and Docteur-Penfield Post
In general, VCS help you keep track of how your files change over time, and, if things go south, easily recover. * Version control is like an unlimited undo/redo * Version control also allows many people to work in parallel.
Note: The basic structure of this introductory lesson is from: https://git-scm.com/book/en/v2/
One Distributed Version Control system is called Git.
Git emerged in 2005 out of the Linux development community. It is primarily used for code management in software development, but is also increasingly used by social scientists who collaborate or wish to publicize their data, code, and work more generally.
With Git, every time you commit, or save the state of your project, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
If a specific file has not changed, Git doesn’t store the file again, just a link to the previous identical file it has already stored. Git treats its data more like a stream of snapshots.
Git has four main states that your files can reside in: unmodified, modified, staged, and commited:
The basic Git workflow goes something like this:
Before going further, we need:
The best way to learn how to use Git is through the Command Line.
Using the Command Line lets you communicate directly with your computer and allows you to perform specific tasks through specific commands.
And your best friends:
Create a new file and add it to your .git directory
Delete everything from your .csv file, save it, and add those changes to your .git directory (and commit them!). Can you retrieve your data?
GitHub is the single largest host for Git repositories, and is the central point of collaboration for millions of developers and projects
For students you can get the GitHub Student Developer Pack which gives you unlimited private repositories and numerous other perks.
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
Source: T. Russell Harris
At this point, one member of the team and the remote repository have the most up-to-date version, but the others do not. To get the changes, you use the git pull command. Make sure you are in the correct working directory!
Remember:
If you get stuck that is fine - we will go over some ways to fix things.
Just make sure to stage and commit your changes.
There is no shame in sometimes going nuclear:
Remember that the remote repo keeps the .git history so you can revert at any time!
It is pretty straightforward to set up an personal website with the address <username>.github.io. Hosting is free and you can host presentations, resources, etc. such as this one.
You can place a .gitignore file into your local repository if you want git to consistenty ignore a certain set of files or paths.
Windows users see: https://stackoverflow.com/questions/10744305/how-to-create-gitignore-file/34995806