6  Working with a Remote

For now, you only have a local project. This step will explain how to push your project to a remote repository on GitHub.

6.1 Create an empty repository

  1. Go to github.com
  2. Create a new public repository named username.github.io, where username is your username
  • Example: my username is dhmmasson, my repository is dhmmasson.github.io
  • The repository should be public
  • The repository should be empty (do not initialize this repository)
  1. Copy the resulting url:
  • For the username dhmmasson, the url looks like that: https://github.com/dhmmasson/dhmmasson.github.io.git

6.2 Git Push

  1. Go back to smartgit, in your local repository.
  2. In the menu Remote > Add

6.3 Git Token

If you haven’t already, you need to create a token to push your project to github. Create a token

6.4 Cloning

  1. Commit and push all your change.
    • If SmartGit asks for the login/password, use your access token (previous step) instead of your password.
    • Click save credentials to make sure you do not have to worry about it anymore!
  2. Visit the repository on github (https://github.com//.github.io)
  3. Delete your local repository
  4. Clone the project back from github

7 Finishing up

7.1 README

All repository should contains a README file. A README is a text file that introduces and explains a project. It contains information that is commonly required to understand what the project is about. It should explain how to install, use or contribute to your project.

It should be the first file you create on a project as it will give you the habit of documenting your projects. READMEs are usually written in a format called markdown that allows you to easily write formatted text with a text editor.

Today, we will use it to mark what we have to do for this activity.

# My page

This is my home page

Create the file Readme with .md extension.