GIT

Undo all uncommitted changes in Git

Unstage all files you might have staged with git add: git reset Revert all local uncommitted changes (should be executed in repository root): git checkout . Revert all uncommitted changes git reset --hard HEAD Remove all local un tracked files, so only git tracked files remain git clean -fdx Undo [...]

2017-03-07T12:49:05+05:30Categories: Version Control|Tags: |

Sync local repo with remote one in Git

Local code repository can be synchronized with remote by following different ways :- git fetch --prune -p, --prune After fetching, remove any remote-tracking branches which no longer exist on the remote. git fetch origin git reset --hard origin/master git clean -f -d This makes your local repository exactly like your [...]

2017-01-31T14:17:55+05:30Categories: Version Control|Tags: |

Common Commands | Git

The git init command creates a new Git repository. It can be used to convert an existing, unversioned project to a Git repository or initialize a new empty repository. git add git add '.c'  // Add all files with '.c' extension. git add -all // Add all files to stagged [...]

2019-11-11T16:19:24+05:30Categories: Version Control|Tags: |

Git basics

  File states Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database. Modified means that you have changed the file but have not committed it to your database yet. Staged means that [...]

2017-01-20T01:59:29+05:30Categories: Version Control|Tags: |

Create New Repository in Git

Introduction The purpose of Git is to manage a project, or a set of files, as they change over time. Git stores this information in a data structure called a repository. The .git folder in a git repository is used by GIT programs to store information about the repository. Below [...]

2021-03-12T00:49:37+05:30Categories: Version Control|Tags: |
Go to Top