Category Archives: GIT

Compound Indexes MongoDB Java Example

Compound Indexes MongoDB Java Example

Having a requirement on searchingIndexing in MongoDB multiple keys in a query or need the result in the sorted order on the basis of multiple keys this is where Compound Indexes come into the picture. If we look at our previous post example – Simple Index MongoDB Java Example,where we have created index on key username such that whenever we performs a query on userName key it always gives us the record in the optimal time and in sorted order of username. Now if I want my result to be in ascending order of age and descending order of username then in that case it won’t be optimized as results are not stored in the ascending order of age because we don’t have any index on age key. Continue reading Compound Indexes MongoDB Java Example

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Single Field Indexes MongoDB Java Example

Indexing MongoDB Java Example

Indexing in MongoDB works in theIndexing in MongoDB same way as it is used to work in relational databases.It helps in the fast retrieval of documents available in MongDB . Having an index over a collection ensures that least numbers of documents are scanned to find the documents matching search criteria. Hence having an understanding of indexes is very important for the efficient performance of your application. In this post we will cover: Continue reading Single Field Indexes MongoDB Java Example

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

How to add existing projects to Github ?

Version control is an importantUnderstand git clone , svn checkout Vs git clone aspect of any application development, it allows you to access your code base from different machines ,allows you to make lot of mistakes and then correct them before delivering a final product ,allows you to track the progress of your project and much more. If you are reading this post I am assuming that you are having a project that you want to move on Github. Continue reading How to add existing projects to Github ?

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Revert or Undo a commit using git amend

In the previous post we have seen that how we can revert or undo a local or public git commit using git revert. In this post we are going to see some other ways in which we can Revert or Undo a commit using git. Yes, you have read it right only we are talking about only local commit.

Note : There are lot of things in life and git can’t be undone always .

Undo a commit using git amend :
Let’s consider a scenario where you have just started development of your application , and now you have lot of files to checkin into the git repository so for doing that you have to do a Continue reading Revert or Undo a commit using git amend

Revert or undo last git commit

If you have missed out my previous posts on git repositories then you can read it here.

While working on GIT distributed version control system , you might have found yourself in a scenario where you have to revert or undo last git commit. Reason for revert can be anything like wrong file checked in , some junk code has been checked in that can impact your well developed application etc.

Now here two scenario exists depends on the level of your commit–
1. If the commit has been already pushed to central remote repository that means now it is a public commit that means other developers can see these changes. Continue reading Revert or undo last git commit

Bare and Non Bare Repositories , .git directory and working tree

Understand git clone , svn checkout Vs git cloneThese days I am busy in learning GIT distributed versioning system as our project is going to be sit on it, so I am reading a lot and trying to understand it so that I can take full advantage of it in my project.In my previous post we have seen the working of git clone command and how it is different from svn checkout.
In this post we are going to see some differences between bare and non bare repositories, which one to use when.
A normal GIT Repository basically made up of 2 components –

1. Working directory : In simple terms it is the place where all checked out files reside and file available in this location can be added to git repository by

git add FILE_NAME

.2. .git Directory : In simple terms this directory contains all the administrative related files and data that are required by GIT to support all the commands like git commit, git status , git pull, git push. This directory is always present in the root of your project directory.

So , let’s start looking into the bare and non bare repositories Continue reading Bare and Non Bare Repositories , .git directory and working tree

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Understand git clone command, difference between svn checkout and git clone

Understand git clone , svn checkout Vs git cloneRecently our project migrated from SVN to GIT Distributed Version Control and later I came to know that it has lot of advantages over SVN. So I started looking into GIT basic terminology like clone , commit , pull , push fetch , rebase , merge , branches and honestly speaking earlier I was very confused but as soon I started going into the depth I found it interesting and something that I have never worked till now. I read lot of books , lot of blogs on basic GIT terminologies and here I am going to write my findings on same, so that it can help newbies like me and most importantly for my future reference.

So whole story begins with how to get the code into your local system Continue reading Understand git clone command, difference between svn checkout and git clone

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Install GIT on Windows

In this post I am going to complete the remaining part of my previous post on Git Distributed Version Control System and its configuration on Windows, if you have missed out that post you can read it here.

Before we start looking into the details of how to install GIT on Windows , there are some prerequisites that you have to take care of.

  • URL of your source GIT Repository from where you will clone the code. Something like this                                                                         Ssh://username@servername:gitproject .
  • Firewall should be opened for port 22 ,for SSH communication. Continue reading Install GIT on Windows