Git Product home page Git Product logo

gitpractice's Introduction

Practicegit

Git

Git is used to keep track of changes in the source code.

Github

Github is used to host the source code.

Git shortcuts

  • git status -> Displays the state of the working dir.
  • git add . -> Adds a change in the working dir to the staging area.
  • git commit -m "" -> Used to save changes to the local repo.
  • git reset --soft -> Keep the files and stage all changes back.
  • git reset --hard -> Completely destroy changes.
  • git log -> Allows viewing the git log as graph.
  • git diff -> To track the changes.
  • .gitignore -> Used to ignore a file that commited in the past.
  • .gitversion -> To know the specific version of the file.
  • git checkout -b -> To create new branch
  • git branch -D -> To delete the branch
  • git branch -> Pointers to a snapshot of the changes.
  • git checkout -> Switch to a new branch
  • git push -> Used to push the local repo.
  • git pull -> Used to fetch and merge code changes.

Merge conflict and how to solve it

It's an event that takes place when git is unable to automatically resolve differences in code between two commits.

  • git remote add origin
  • git pull origin master
  • git status
  • git add .
  • git commit -m "commit message"
  • git push origin master

Git stash

  • git stash pop -> throws away the topmost by default statsh after applying it.
  • git stash apply -> leaves it in the stash list for possible later reuse.

Git rebase

  • git reabse -> Rebasing is the process of moving or combining a sequence of commits to a new base commit.
  • git commit -a -m ""
  • git rebase
  • git rebase --onto <>

To know more about git commands - https://www.atlassian.com/git/glossary Git documentation - https://git-scm.com/docs/git.

gitpractice's People

Contributors

navyashree0923 avatar

Stargazers

 avatar

Watchers

 avatar

gitpractice's Issues

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.