GithubHelp home page GithubHelp logo

sheikhshahnawaz41299 / introduction-to-git-and-github-by-google-coursera Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paareshc/introduction-to-git-and-github-by-google-coursera

0.0 1.0 0.0 63 KB

Solutions

introduction-to-git-and-github-by-google-coursera's Introduction

Ultimate Git Cheat Sheet , Author : PaareshC

===========================================================

Remember :

The only way to master Git is through Practice

Configuring you Git

Syntax Description
$ git config --global user.name "Username" Sets the name you want attached to your commit transactions
$ git config --global user.email "Email" Sets the email you want attached to your commit transactions
$ git config --global color.ui auto Colorization of command line output

Creating Repository

Syntax Description
$ git init Turn an existing directory into a git repository
$ git clone [url] Clone a repository that already exists on GitHub

Operations on Files

Syntax Description
$ git add Adds a file to Staging area
$ git add * Adds all files to Staging area
$ git commit -a Stages files automatically
$ git log -p Produces patch text
$ git show Shows various objects
$ git diff Can show the differences in various commits
$ git diff --staged Show all staged files compared to the named commit
$ git add -p Allows a user to interactively review patches to add to the current commit
$ git mv Moves a file
$ git rm Removes a file

Reverting Changes

Syntax Description
$ git reset Resets the repo, throwing away some changes
$ git commit --amend Make changes to commits
$ git revert New commit which effectively rolls back a previous commit

Branches

Syntax Description
$ git branch Used to manage branches
$ git branch Creates the branch
$ git branch -d Deletes the branch
$ git branch -D Forcibly deletes the branch
$ git checkout Switches to a branch
$ git checkout -b Creates a new branch and switches to it
$ git merge Merge joins branches together
$ git merge --abort abort the merge action (In case of merge conflict)
$ git log --graph --oneline This shows a summarized view of the commit history for a repo

Interaction with Remote Repository

Syntax Description
$ git push Git push is used to push commits from your local repo to a remote repo
$ git pull Git pull is used to fetch the newest updates from a remote repository

Remotes

Syntax Description
$ git remote Lists remote repos
$ git remote -v List remote repos verbosely
$ git remote show Describes a single remote repo
$ git remote update Fetches the most up-to-date objects
$ git fetch Downloads specific objects
$ git branch -r Lists remote branches; can be combined with other branch arguments to manage remote branches

introduction-to-git-and-github-by-google-coursera's People

Contributors

paareshc avatar

Watchers

James Cloos 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.