Introduction to Git 🌳 and GitHub 📁
For our introduction to git and Github, we’ll be using two resources.
For a brief overview, read and follow along https://melaniewalsh.github.io/Intro-Cultural-Analytics/04-Data-Collection/04-Git-GitHub.html until the Download a Github Repository. At which point we’ll switch over to Shane Lin’s Git for Humanists. We’ll see how far we get in working through this during class and the rest will be homework for next week.
In Class Exercise:
- Create a new repository on Github, following these instructions: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository
- Clone that repository to your local computer following https://shane-et-al.github.io/git_slab/#creatingcloning-a-repository.
- Enter your repository and add in a new file using
touch
andecho
commands. - Save your file and commit your changes using
git add
andgit commit
. - Try getting your file onto Github using merging and pushing your changes using
git push
.
Feel free to use the git cheatsheat from Github https://education.github.com/git-cheat-sheet-education.pdf
Git & Github Assignment
- Create a new repository on Github with the name is310-final-project (or something close to that).
- Clone the repository from Github to your local machine.
- Add in a README.md file using the command line and then add some text using VS Code or your preferred text editor.
- New to or need a refresh for Markdown? Read this Programming Historian Tutorial https://programminghistorian.org/en/lessons/getting-started-with-markdown.
- Stage and commit your changes.
- Push your changes to your Github repository.
- Add a link to your repository in our main repo’s discussion https://github.com/ZoeLeBlanc/is310-computing-humanities/discussions/2.
Putting It Together
Returning to Shane Lin’s Git for Humanists, there’s a few things we want to review.
First, using this section from Creating/Cloning a Repository, Git for Humanists and the Github git cheatsheet, let’s try and answer the following questions:
- How do we create or clone a repository on Github?
- How do we create a new git directory on our local computer?
- How do we check the status of our local repository?
Second, using this section from Stage and Commit, Git for Humanists, let’s try and answer the following questions:
- How do we add a file to our local repository?
- How do we add text to our newly created file?
- How do we check the status of this file?
Third and last, using this section from Synchronization, Git for Humanists, let’s try and answer the following questions:
- How do we commit our changes?
- How do we push our changes to Github?
- How do we see our changes on Github?