GitHub – Create a Branch and add a readme file

  1. Name branch  : git branch branchName
  2. Show branches : git branch
  3. Switch to branch git checkout branchName
  4. The touch command is the easiest way to create new, empty files. touch README.md
  5. The git status command displays the state of the working directory. git status
  6. Add all the files  git add .
  7. Commit the files with a comment git commit -m "add readme file"
  8. Push files to the remote repository on GitHub git push origin branchName

Done

 

GitHub – Push Your Project

  1. Create a repository : https://github.com/new
    More infos here : Creating a repository
  2. Initialize  your local repository :
    1. Open Terminal (on OSX).
    2. Go to your local project directory (Introduction to the Mac OS X Command Line).
    3. Type git init
  3. Add all the files  git add .
  4. Commit the files with a comment git commit -m "initial commit"
  5.  Add our remote repository from GitHub git remote add origin https://github.com/<github username>/<repository>.git
  6. Push files to the remote repository on GitHub git push origin master

Our project is on gitHub 🙂

Git Commands:

  • git push origin master: send changes to the master branch of your remote repository
  • git init: initialize a git repository in your directory
  • git status: check the status of the repository
  • git add file_name: add one file
  • git add .: add all files
  • git commit -m “commit message”: commit your files along with a message
  • git remote add origin https://github.com/username/reponame.git – the remote url to your GitHub repo
  • git push origin master: push your files up to github on the master branch

More Basic Git commands and more documentation

 

 

 

GitHub – user interface

GitHub is a website for hosting and collaborating on projects.
Git is a version control system.

Repository
A repository is the most basic element of GitHub, a projects folder.
A repository contains all the project files, including documentation and stores the history of each file.


The Code view
The Code view is where you’ll find the files included in the repository.
These files may contain the source code or any documentation, a LICENSE file and a README.

The LICENSE file
Public repositories on GitHub are often used to share open source software. For your repository to truly be open source, you’ll need to license it so that others are free to use, change, and distribute the software.
More about License
Click here to Choose an open source license

The README file
The README is a special file that explains the project and depending on the repo, information on how to get started and how to contribute. The README.md file is shown at the bottom of the repository home page.


The watch button
Click the watch button at the top of the page to stay up-to-date with changes.

The Star button
Starring is the most simple way to let project owners know you appreciate their work.

The fork button
A fork is a copy of a repository similar to a branch. It is used when you don’t have access to a project or to propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea. Forking a repository allows you to freely experiment with changes without affecting the original project.

Learn web design, coding and much more with Treehouse.