Sunday, December 29, 2013

Commonly used git commands

  • git checkout oldbranch # Checkout an existing branch
  • git checkout -b newbranchname  # Create a new branch 
  • git checkout -b newbranch remote/newbranch # to avoid confusions

  • git status  # See your changes

  • git branch --all | grep pattern      # All branches in all repos you have added
  • git branch                                     # to list local branches

  • git push --dry-run     # See what you are going to push
  • git push                     # Actually push

  • git config branch.branchname.remote    # to see the value
  • git config branch.branchname.remote  privatebranch   # to set the value

  • git config branch.branchname.merge
  • git config branch.branchname.merge branchname # the remote merge branch 

 # Show all commit logs for all commits on branch1 that are not on branch2
  • git log branch1 ^branch2 --no-merges 
  •   git push origin :branchname    # Delete a remote branch
  •  git remote add newrem git+ssh://path.to.git/remote
# Run this as soon as you add a remote repository. To download all branches.
  • git fetch
  • git fetch remote
   

Wednesday, February 27, 2013

Using screen to manage your terminal windows

You can use screen if you need to have more than one terminal window open to at the same time.

The advantage of screen is that even if there is an internet problem, you can reattach to the screen where you were working on once your internet is back up.

screen                             Will open a new screen
exit                                  To quit the screen, and go back to the shell
screen -ls                         Display a list of all screens
screen -d screen_name     Detach from screen_name

In Screen, you type Control-a and then you can type in your command. Below are a few common commands.

Ctrl-A :sessionname dev_server    Names the current screen dev_server

Ctrl-A c         Open a new screen
Ctrl-a n          Switch to next screen
Ctrl-a p          Switch to previous screen
Ctrl-a \           Quit and kill all your windows

Wednesday, January 30, 2013

How to get your first software job

Good advice on how to get your first software job at http://youtu.be/snMOeLxVQPg

Make something. Anything. When you do, you learn. And you show the company why they should hire you.