kim-nguyenkhn / git-tutorial

Basic tutorial & practice environment for first time git-users.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git-tutorial

Basic tutorial & practice environment for first time git-users.

Pre-Setup

  1. Make sure you have Git installed on your computer.
  2. And of course, make sure you have a registered GitHub account.
  3. Finally, have a text editor ready such as Atom or Sublime Text.

Instructions

tldr;
1. Fork the repo into your profile.
2. Clone your own fork in your terminal window.
3. Open kittens.md & make changes.
4. Commit & push your changes.
5. Create a new Pull Request (PR) to merge your changes into kim-nguyenkhn/git-tutorial.

Use the Git Cheat Sheet here if you don't remember the commands.

1. Forking

Forking

Fork the repository. This creates an exact copy of the "git-tutorial" repository into your own profile. After forking, you should be able to view it from your profile's list of repositories.

2. Cloning

Cloning

Cloning - Terminal

Clone the repository. This command puts a copy of the Git repository onto your local machine, so you can work with it.

Use this Linux Command Line Cheat Sheet if you get lost in the terminal.

cd ~/Documents                              (Change directory - Navigate to where you want your local copy to live)
pwd                                         (Show current directory)
git clone <YOUR_FORK_HTTPS_GIT_URL_HERE>    (Clone your fork .git URL)
cd git-tutorial                             (Go into your newly cloned directory)
ls                                          (List files to verify)

3. Making changes

Making Changes

Making Changes

Download Atom or Sublime Text for free. Open kittens.md in your text editor and make your changes.

4. Committing & Pushing

Git Diff

Git Commit

Git Push

Make sure you are in your local "git-tutorial" directory. Use the commands below to verify & publish your changes.

git diff                                (Shows local changes to tracked files)
git add <file>                          (Adds/stages a file to the next commit)
git commit -m "some commit message"     (Commits previously staged changes)
git push                                (Publish local changes into your fork)

5. Creating a Pull Request

New Pull Request

Compare Forks

Click "New Pull Request." Click "Compare Across Forks". Select your fork from the dropdown.

Click the big green "Create Pull Request" button to finish. From there, I'll merge the PR and you should see your resulting changes in kittens.md.

About

Basic tutorial & practice environment for first time git-users.

License:MIT License