Wednesday, October 29, 2014

GIT : Branching


Git Branching is the basic need in Git Version control.

Here i like to share the steps to manage the branch in your application repository.

Step 1: I am assuming initially you have "master" branch in your application then you create another branch i.e. "development" then run the below command:

# git branch development

# git checkout development  

//it will switch the branch into "development" branch

Step 2: Now your are in fresh "development" branch. Then push your "master" branch code into the "development" branch.

# git push origin development

GIT clone form specific branch

# git clone <git-repo-url> -b <branch-name> --single-branch

Suppose i had to take git clone of specific branch like development-fix not all others then my command would be

# git clone -b development-fix --single-branch


Wednesday, October 15, 2014

Linux: How to compare multiple files in given directories


In linux, any flavor you are using, you can find out the file's content differences in two directory.

For example :
You have directory "test1" and "test2" both contains the multiple files and directory.

And your problem is to find out files where content are mismatch with the "test1" directory's file.

So, do not worry about this. Linux provide a very powerful tool to find out the differences i.e diff command:

# diff -qrs test1/ test2/ 

-q : report only when files differ
-r : recursively compare any subdirectories found
-s : report when two files are the same

Above command will give you output in report format where files content differ or identical.

If you found something differ in your file in the final report, then you can run the below command to see the actual differences.

# diff test1/file1 test2/file1