I have been using Ubuntu for most of my development works for a long time. But recently I also started working on a Mac on one of my projects. This was the first time I was using it. Most of the things felt homely but the first thing that caught my attention was, there no auto-complete feature available on the terminal for Git commands. Git is the first step to start working on any project, so this small thing was what I wanted to fix on Mac. I asked few of my fellow Mac using friends but they said it
[git-sh] (git shell) is an interactive shell for git and its new way to use Git. git-sh provides a dedicated shell just for our Git commands. Installing git-sh: $ sudo apt-get install git-sh Start a shell with git-sh: $ cd liquor $ git-sh master!liquor *> At its simplest, git-sh saves you from typing the word git over and over. We are familier with these type of git commands: $ git status $ git add -p $ git commit $ git push With git-sh this gets easier: $ git-sh master!liquor *> status master!liquor *> add -p master!liquor *> commit -m "message" master!
Avoid git prompt for password Locate the file ~/.netrc on linux based system (generally its hidden file in Home folder). Add following details in this file for github. machine github.com login < username > password < password > and save it On next git pull, git push, it will not prompt for username/password. Attached sample ~/.netrc file
Git Aliases and set it up in UNIX I have created a list of git aliases that can be used in our day to day work. Most of us might have configured this. But I have listed few more aliases that are normally not used. like 'ggr' # Add and Removes alias "ga"='git add' alias "gai"='git add -i' alias 'grm'='git rm' alias 'gra'='git remote add' alias "grr"='git remote rm' # Commit and Pushes alias "gcm"='git commit -m' alias "gca"='git commit -am' alias "gp"='git push' alias "gpu"='git pull' alias "gpo"='git push origin' alias
hub is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier. Install $ gem install hub $ hub hub standalone > ~/bin/hub && chmod +x ~/bin/hub check successful installation with $hub version Create a new github repo demo-project$ git create [NAME] [-p] [-d DESCRIPTION] [-h HOMEPAGE] annotations -p create a private repository -d set the repository's description -h set the homepage URL This will create a new public GitHub repository from the current git repository and add remote origin at "email@example.com:USER/REPOSITORY.git"