Giter Club home page Giter Club logo

learning-git's Introduction

Learning Git

  1. Initialize empty git repo : git init
  2. Add file : git add filename.txt
  3. Commit : git commit -m "Some commit message"
  4. Check Status : git status
  5. List of tracked files : git ls-files
  6. Unstage : git reset HEAD filename.txt
  7. Revert to last commit : git checkout -- filename.txt
  8. Rename file using git : git mv filename.txt newfilename.txt
  9. Unstage a rename : git mn newfilename.txt filename.txt
  10. Delete a tracked file : git rm filename.txt
  11. Check commit history : git log
  12. Commit history in oneline and decorated with branching graph : git log --oneline --graph --decorated
  13. Commit history in a range : git log commit_hash_1...commit_hash_2
  14. Commit history some time ago : git log --since="1 hours ago" or git log --since="3 days ago"
  15. Commit history of a specific file : git log -- filename.txt
  16. Create alias : git config --global alias.alias_name "command after git goes here"
  17. Compare staged and unstaged changes : git diff
  18. Compare unstaged change with last commit : git diff HEAD
  19. Compare staged change with last commit : git diff --staged HEAD
  20. Limit diff to a specific file : git diff -- filename
  21. Compare between two commits : git diff commit_id_1 commit_id_2
  22. List all branches : git branch -a
  23. Create a new Branch : git branch my_new_branch_name
  24. Change branch : git checkout branch_name
  25. Change branch name : git branch -m oldName newName
  26. Delete Branch : git branch -d branchName
  27. Create and Change branch simultaneouly : git checkout -b branchName
  28. Merge a branch : git merge branch_name

learning-git's People

Contributors

bera5186 avatar

Watchers

 avatar

Forkers

bhaskarjha514

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.