Giter Club home page Giter Club logo

learn-git's Introduction

Learn Git

Git Logo

What is Git?

Git is free and open-source version control system. A version control system, or VCS, tracks the history of changes as people and teams collaborate on projects together. As developers make changes to the project, any earlier version of the project can be recovered at any time.

Developers can review project history to find out:

  • Which changes were made?
  • Who made the changes?
  • When were the changes made?
  • Why were changes needed?

About repositories

A repository, or Git project, encompasses the entire collection of files and folders associated with a project, along with each file's revision history.

  • The file history appears as snapshots in time called commits.
  • The commits can be organized into multiple lines of development called branches. Because Git is a DVCS, repositories are self-contained units and anyone who has a copy of the repository can access the entire codebase and its history.

Using the command line or other ease-of-use interfaces, a Git repository also allows for: interaction with the history, cloning the repository, creating branches, committing, merging, comparing changes across versions of code, and more.

Through platforms like GitHub, Git also provides more opportunities for project transparency and collaboration. Public repositories help teams work together to build the best possible final product.

Git commands

Git: Configurations

(global settings)

  • git config --global user.email "[email protected]"
  • git config --global user.name "Your Name"
  • git config --global color.ui true
  • git config --list

(local/repo settings)

Git: Starting a Repo

  • git init [repo name]
  • git clone [cloning-address-of-remote-repo]
  • git status

Git: Staging files

  • git add [file name[s]]
  • git add .
  • git add --all
  • git add -A
  • git rm --cached [file name]
  • git reset [file name]

Git: Commiting to a repo

  • git commit -m "[title]" -m "[description]"
  • git reset
  • git reset --soft HEAD^
  • git commit --amend -m "enter your message"

Git: Other useful commands

  • git push origin main
  • git branch [branch name] OR git -b checkout [branch name]
  • git checkout [branch name]
  • git remote
  • git pull
  • git merge [branch name]
  • git diff
  • git revert
  • git tag
  • git log

To connect your Git with your GitHub account;

https://rubygarage.s3.amazonaws.com/uploads/article_image/file/599/git-cheatsheet-5.jpg

learn-git's People

Contributors

touseefdotdev avatar

Watchers

 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.