You are on page 1of 3

INFO2180 Tutorial 2

In this tutorial you will discuss the basics of using the command line and
Git.

Command line/Terminal

To learn more about the command line, read and go through some of the
commands in the following links:

• https://news.codecademy.com/getting-comfortable-in-terminal-linux/
• https://www.codecademy.com/articles/command-line-commands

Git

As you go through this course you will be using Git and Github with your
programming projects. This will give you good practice not just for this
course but also for when you go out into the working world as many
organizations are using version control for source code management.

Go through the following Git Tutorial to learn the basics of using Git:
• Git Handbook: https://guides.github.com/introduction/git-handbook/

Discussion Questions

1. What is the command line?


2. What applications can you use to access the command line?
3. What are some of the basic and most common command line/terminal
commands that you know of? What do each of the commands do?
4. What is Git and why is it useful?
5. If you are not currently using a version control system like Git how do
you currently track changes to your source code?
6. When you are working on projects with multiple persons, how do you
currently ensure that everyone has the latest version of your code?
7. What if someone makes a mistake and introduces a bug in your code,
how are you are able to go back to a previous working version?
8. How can a version control system like Git help to avoid these and other
problems?
9. Do you know of any services online where you can remotely host your
Git repositories?
10.What are some git commands that you know of and what do they do?
11.To add changes to your les to the Staging Area in Git what command
would you use?
12.If you then want to store your staged changes to your Git repository
what command would you use?
13.What if you wanted to undo changes that you have made to a le that
was staged in your repository?
14.When developers are working on a new feature or bug they want to x
they'll often create a copy or branch of their code they can make
separate commits to. How is this done in Git?
15.Once you or a team member are satis ed that your new feature is
working or bug is xed how do you merge those changes?
16.Changes that are committed to your repository are done locally (on
your personal computer) rst. How would we now push these changes
to a remote repository (e.g. on Github) so that our other team members
can also see and get our changes?
fi
fi
fi
fi
fi
fi
The following resources will be helpful:

• Installing Git - https://git-scm.com/book/en/v2/Getting-Started-


Installing-Git
• Learn Git - https://www.codecademy.com/learn/learn-git
• W3 Schools Git Tutorial - https://www.w3schools.com/git/
• Atlassian Git Guide - https://www.atlassian.com/git/tutorials/what-is-
version-control
• Github Docs - https://docs.github.com/en/get-started/quickstart/hello-
world
• Github Desktop GUI - https://desktop.github.com/

At the end of this tutorial you should know the following Git commands:

• git init
• git status
• git add
• git commit m
• git log
• git checkout
• git reset
• git branch
• git merge
• git remote
• git pull
• git push
-

You might also like