Git Product home page Git Product logo

hasgtomn / introduction-to-git-and-github Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roman79/introduction-to-git-and-github

0.0 0.0 0.0 47 KB

Git is the most popular distributed version control system. Git is an open source and it is created by the same people who developed Linux (Linus Torvalds). Git allows you to track files and file changes in a repository “repo” (folder). Everything is stored in local repositories on your computer. Git makes changes and tracks modification to the files stored in GitHub. Git synchronize repository and code between different people.

License: MIT License

introduction-to-git-and-github's Introduction

Introduction-to-Git-and-GitHub

Git is the most popular distributed version control system. Git is an open source and it is created by the same people who developed Linux (Linus Torvalds). Git allows you to track files and file changes in a repository “repo” (folder). Everything is stored in local repositories on your computer. Git makes changes and tracks modifications to the files stored in GitHub. Git synchronize repository and code between different people.

GitHub is version control repository and Internet hosting service. It is store repos and files online. It is like Dropbox for Git repos.

Git and GitHub help to create and manage projects, and more importantly, they allow team members to change and collaborate on the projects.

Links:

Download and install Git.

Open Git Bash (Windows)

git status --help To get help on a particular git command

Setup git on your computer

git config --global user.name "your name"

git config --global user.email "[email protected]"

Note! You will need to use the same email address for Git and GitHub.

Git Diagram

Git commands

The git init command creates a new Git repository.

The git clone url or path copies an existing Git repository. (This can either be a repository stored locally on your computer, or one that exists remotely on the GitHub website).

The git add . command tells Git to add all file to a temporary "staging area".

The git commit -m "updated" tells Git to save a snapshot of your files that are currently in the staging area. Once you have committed your changes, Git will add that snapshot to its history. In future you can revert your code to that particular point in time.

The git push origin master send all commited changes to remote repository - GitHub.

The git status command tells you a useful summary of the current status of your repository.

The git log command will show you a list of all those commits, with a unique ID, a timestamp and a message.

The git diff will show you a list of all the changes that you have made in your files - compared to the version that you last committed to Git.

The git pull retrives changes from remote repository

Setup GitHub account

Sign up or sign in, if you have existing account.

Star, Fork and Clone or Download buttons

  • If you like the repo, you can click Star button. The repo will be filtered by star in your GitHub.

  • The Fork button allows you to copy and save repo to your GitHub. This will allow you to contribute with others on that repository.

  • Clone or Download button will allows you to clone URL or download zip file.

Practice exercise 1 Create your first repo in GitHub

Public is a default and it is free but the content of the repo is available to everyone.

It is better to add README.md file.

My solution to exercise 1

Markdown is a way to style text on the web.

Practice exercise 2 Update your repo

Clone your repo to your computer.

Update README.md locally and push to your remore repository (GitHub).

You do not need to initialize repo git init if you cloned the repo to your computer. If you just started Git follow the below commands

My solution to exercise 2

Practice exercise 3 Update and add files to your repo

Update your README.md and add files and folders to your local repository and push to your remote repository (GitHub).

My solution to exercise 3

To remove repository from GitHub > Settings > Delete this repository > Type repository name

If you find any typos please let me know. Thanks

introduction-to-git-and-github's People

Contributors

roman785 avatar roman79 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.