Skip to content

sharankan/git-lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 

Repository files navigation

Let's learn about Git!


Let's practice

Before you start:

  1. Create a github acccount.
  2. check that you have git installed:
  3. Open the git bash application (we will be using gitBash to write git command throughout the tutorial)

⚠️This week's deliverables

Completing assignments Part I and Part II is compulsory.
This is your deliverable for the week.
It is very important to complete it, demonstrating git skills is part of the minimum learning outcomes for CS2001.
As a bonus, you will also get a git batch to display on your giuthub page :octocat:
For your deliverable to be accepted you have to:

  • Step 1: Complete the assignment in Part I
    • Make sure that your file is added to the COLLABORATORS folder of the Git-it repository, hence your PullRequest has to be accepted.
  • Step 2: Complete the assignment in Part II. Make sure you have pushed your changes and the file with your student id is in the repository.

Part I: Basic git skills

The purpose of this exercise it to practice basic git commands, and to learn about Pull Requests.
We will be using an application, called Git-It.
This is just an application that makes git tutorials easy.
To complete this exercise you have to complete all challenges from the Git-it application.
Let's get started, follow the steps below.

  • Step 1: Install the Git-It application
    • Install it form here
    • Click and download the .zip version that corresponds to your operating system! (do not download the source code)
    • If you are struggling, read the install instructions here
  • Step 2: Start the application
  • Step 3: Complete all challenges

Part II: Clone, Add, Commit, Pull, Push!

In this exercise, you will have to clone an existing application, create a file and modify an existing file.
Let's get strated, follow the steps below:

  • Step 1: Accept the assignment invitation from this link
    Accepting the invitation will create a copy of the repository for you.
    The name of the assignement repository will be something like: git-lab-yourusername
    In the above yourUserName will be your actual github name
    The link to your repository will be: https://github.com/BrunelCS/git-lab-yourUserName
    Again, note that yours will have the same naming convention but instead of yourUserName, there will be your github username
  • Step 2: Clone the repository from the assignment link above, use the git clone command
    • Open gitBash
    • Clone the repository. git clone https://github.com/BrunelCS/git-lab-yourusername
      The above assumes that the name of your repository is https://github.com/BrunelCS/git-lab-yourusername,
    • Move inside the repository folder
      cd git-lab-yourusername
  • Step 3: Open the file HelloWorld.java and modify the text to say: "I am a git master".
  • Step 4: Add a new file, the name of the file should be your student id
    • For example, if your student name is 191827, then add a file with the name 191827.txt
    • Make sure that the file is in the root directory, the same directory where the readme file is
    • Do not put your file in the src directory
  • Step 5: Add content to the file. The content should be: Hello, my name is [Put your name here].
  • Step 6: Commit and push your changes to your repository assignment.

Part III: 🐾 Git hunt: a treasure hunt game with Git

Now when we know the basics of git, let's have some fun with it.
We will play a treasure hunt game.
Let's get started. Follow this link
The game is hard, you really have to be a git master to complete it.
Feel free to ask for help and to work together.
To make things more fun, we will start a little competition.
There are prizes (git stickers) for whoever manages to complete it! Good luck!
You will also be listed on the lab page as Gitter of the week!

Part IV: Finally, it is time to test your git knowledge

  • Test your git knowledge here
  • Make sure that you can:
    • contribute to an existing repository (hint)
    • start a new repository and publish it on git (hint)
    • contribute to an existing branch (hint)

📖 Further practice and reading

Congratulations!You have completed this lab session.
You are oficially a git master

But your git journey is far from over. Indeed, it is just starting!
To get better at git, you have to practice.

Practice

Reading

Free Git book (download and read!) Note Chapter 2 is a compulsory (minimal) reading + practice.

About

This tutorial will help you start with git.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%