Comparing the branches in GIT

Use this command to list the files changed between two branches
git diff --name-status <branch-name-1>..<branch-name-2>
This gives list of all the files Modified/Added or Deleted:


M       file.txt
D       file2.txt
M       file3.txt

How to see Git branches


  • To see current branch
    • git branch
  • To see all the branches (local and remote)
    • git branch -a
  • To see only remote branches
    • git branch -r

Checking the Git config for a Repo

Assume you've sample.git checked out in a folder sample


  • CD to sample
  • Type git config -l  to see the current configuration. Example config:

user.name=ABCD
user.email=abcd@gmail.com
color.diff=auto
color.branch=auto
color.status=auto
color.showbranch=auto
alias.cpi=cherry-pick
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=https://github.com/robolectric/RobolectricSample.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.dev.remote=origin
branch.dev.merge=refs/heads/dev

  • Type git config -l  to edit current git configuration. 

Quick Tip on Git Tags

Creating the Tags in Git repo

  • Tagging head of the branch 

git tag -a <tag name> -m "<message to identify tag>"

  • Tagging a particular commit (last seven chars of a commit ID: ed26815)
git tag -a <tag name> -m "<message to identify tag>" ed26815

Pushing the Git Tags to repo (for sharing) 

  • By Name

git push origin <tagname>

  • Pushing all tags at once
git push origin --tags

Scheduling Repeating Local Notifications using Alarm Manager

Learn about Scheduling Repeating Local Notifications using Alarm Manager in this post .