Skip to content

tafaranyamhunga/zero_day

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concepts

For this project, we expect you to look at these concepts:

Resources

Read or watch:

Resources for advanced tasks (Read only after finishing the mandatory tasks)

Learning Objectives

At the end of this project, you are expected to be able to explain to anyone, without the help of Google:

General

  • What is source code management
  • What is Git
  • What is GitHub
  • What is the difference between Git and GitHub
  • How to create a repository
  • What is a README
  • How to write good READMEs
  • How to commit
  • How to write helpful commit messages
  • How to push code
  • How to pull updates
  • How to create a branch
  • How to merge branches
  • How to work as collaborators on a project
  • Which files should and which files should not appear in your repo

Requirements

General

  • A README.md file at the root of the zero_day repo, containing a description of the repository
  • A README.md file, at the root of the folder of this project (i.e. 0x03-git), describing what this project is about
  • Do not use GitHub’s web UI, but the command line to perform the exercise (except for operations that can not possibly be done any other way than through the web UI). You won’t be able to perform many of the task requirements on the web UI, and you should start getting used to the command line for simple tasks because many complex tasks can only be done via the command line.
  • Your answer files should only contain the command, and nothing else

More Info

Basic usage

At the end of this project you should be able to reproduce and understand these command lines:

$ git clone <repo>
$ touch test
$ git add test
$ git commit -m "Initial commit"
$ git push origin main

Quiz questions

Question #0

You have the following files in your project directory:

$ julien@ubuntu:/tmp/git_project$ ls

0-test  0-test~ #0-test# file1  file2

You’ve edited 0-test and you want to add it to your GitHub repo. What is the correct command to add only 0-test ?

  • git add .

  • git add -N 0-test

  • git add 0-test

Tips:

You should learn what each of these commands would actually do if you were to execute them!

Question #1

What command can you use to see what changes have been staged, which haven’t, and which files aren’t being tracked by Git?

  • git init

  • git status

  • git checkout

Tasks

0. Create and setup your Git and GitHub account

Step 0 - Create an account on GitHub [if you do not have one already]

GitHub profile

You will need a GitHub account for all your projects at ALX. If you do not already have a github.com account, you can create an account for free here

Step 1 - Create a Personal Access Token on Github

To have access to your repositories and authenticate yourself, you need to create a Personal Access Token on Github.

Creating a personal access token on GitHub

You can follow this tutorial to create a token.

Step 2 - Create your first repository

Using the graphic interface on the GitHub website, create your first repository.

Creating a repository on GitHub

  • Name: zero_day
  • Description: I'm now an ALX Student, this is my first repository as a full-stack engineer
  • Public repo
  • No README.md, .gitignore, or LICENSE

Step 3 - Open the sandbox

On the intranet, just under the task, click on the button Get a sandbox and run to start the machine.

Once the container is started, click on Webterm to open a shell where you can start work from.

Step 4 - Clone your repository

On the webterm of the sandbox, do the following:

  • Clone your repository
$ root@896cf839cf9a:/# git clone https://{YOUR_PERSONAL_TOKEN}@github.com/{YOUR_USERNAME}/zero_day.git

Cloning into 'zero_day'...
warning: You appear to have cloned an empty repository.

Replace {YOUR_PERSONAL_TOKEN} with your token from step 1

Replace {YOUR_USERNAME} with your username from step 0 and 1

Step 5 - Create the README.md and push the modifications

  • Navigate to this new directory. Tips
$ root@896cf839cf9a:/# cd zero_day/
$ root@896cf839cf9a:/zero_day#
  • Create the file README.md with the content My first readme. Tips
$ root@896cf839cf9a:/zero_day# echo 'My first readme' > README.md
$ root@896cf839cf9a:/zero_day# cat README.md

My first readme
  • Update your git identity
$ root@896cf839cf9a:/zero_day# git config --global user.email "you@example.com"
$ root@896cf839cf9a:/zero_day# git config --global user.name "Your Name"
  • Add this new file to git, commit the change with this message “My first commit” and push to the remote server / origin
$ root@896cf839cf9a:/zero_day# git add .
$ root@896cf839cf9a:/zero_day# git commit -m 'My first commit'
[master (root-commit) 98eef93] My first commit
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

$ root@896cf839cf9a:/zero_day# git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/{YOUR_USERNAME}/zero_day.git
 * [new branch]      master -> master

Good job! 👏

You pushed your first file in your first repository of the first task of your first ALX School project.

You can now check your repository on GitHub to see if everything is good.

Repo:

  • GitHub repository: zero_day
  • File: README.md

1. Repo-session

Create a new directory called 0x03-git in your zero_day repo.

Make sure you include a not empty README.md in your directory:

  • at the root of your repository zero_day/
  • AND in the directory 0x03-git/

And important part: Make sure your commit and push your code to Github - otherwise the Checker will always fail.

Repo:

  • GitHub repository: zero_day
  • Directory: 0x03-git
  • File: README.md

Further instructions for the project are in 0x03-git/, continue from there

About

ALX Software Engineering Git project covering Git fundamentals, branching, merging, collaboration, and repository management.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors