Giter Club home page Giter Club logo

git_management's Introduction

git_management

Different operations to perform for git repositories management

Git repository creation

...

Git clone

git clone <repo_name>

Update online repository

git add -A OR git add OR git add *.extension

Then add commit using command git commit -m "message"

Revert local commits

check git logs to select the header you want to keep

git reset --hard NOTE: This will also remove the files from local directory

Recover the accidently removed files during git reset --hard

git fsck --lost-found

this will returned back to lastest commit now use git rebase

OR

git reset --hard

There are cases where rebase is not powerful enough. For example when you expect to face a lot of conflicts. In this case merge is a better solution:

git merge

If instead you had a few commits one after another but you just want to pick the last one, rebase and merge won’t do. They would bring the whole branch back in master. That’s a situation for cherry-pick.

git cherry-pick

Once you know how to recover from bad mistakes, you’ll find that Git is not only a very powerful tool, but also a very forgiving one. As opposed to a motocross.

The following commands will help you figure you way out of most bad situations:

git show git fsck −−lost-found git diff And these ones will actually get out of these bad situations:

git rebase git cherry-pick git merge git apply

Reference: [1] http://www.programblings.com/2008/06/07/the-illustrated-guide-to-recovering-lost-commits-with-git/

git_management's People

Contributors

shahbazbaig 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.