Friday, March 7, 2014

Git Command Line Basics

Here is a sample workflow, not meant as a complete tutorial, but rather a clean, solid workflow that should get you up and working with Git from the command line in no time.

Setting It Up

If you haven't already, go to Github.com and create a repository for your project (e.g., 'my_project').

Navigate to your project folder, and make sure you know where you are first!:
Tip: replace 'my_projects' and 'my_project' with your own details
Tip: you don't need to type the '$'
Tip: '#' indicates lines generated by your terminal, not typed by you
$ cd ~/my_projects/my_project
$ pwd
# /Users/you/my_projects/my_project

Set your git credentials if you haven't already, then initialize an empty repository for your project:
$ git config --global user.name "Your Name"
$ git config --global user.email your.email@example.com
$ git init

# Initialized empty Git repository in /Users/you/my_projects/my_project/.git/

Add your github.com origin, and if you want, see your origin settings with either of the following two commands:
Tip: replace 'username' and 'repository' with your own details
$ git remote add origin https://github.com//.git
$ git remote show origin
* remote origin   
  Fetch URL: git@github.com:you/my_project.git  
  Push  URL: git@github.com:you/my_project.git  
  HEAD branch: master
  Remote branches
$ git remote -v
# origin https://github.com/you/my_project.git (fetch)
# origin https://github.com/you/my_project.git (push)

If your files are on your desktop, push them up as your master branch:
$ git push -u origin master

Or, if you want to pull down the current version of a remote repository:
$ git pull

If, when trying to pull down the remote repository, you get a message that you have uncommitted changes locally (preventing you from 'fast-forwarding'), you can either dump the changes on your local machine:


$ git reset --hard
$ git pull
or, you can 'stash' those changes for the time being, pull down the remote repository, then re-'apply' those changes:


$ git stash
$ git checkout -b newStuff
$ git stash apply
$ git commit ...

Working

Create a new branch.  At any point you can also check to see what branch you are on (indicated by an '*'), and check your status:
$ git checkout -b my-working-branch 
Switched to a new branch 'my-working-branch ' 
$ git branch 
master 
my-working-branch 
$ git status 
# On branch my-working-branch 
nothing to commit, working directory clean

When you're ready, make sure git has all your new files and changes, then commit your changes to your working branch (with a special message):
$ git add .
$ git commit -m "this is pretty cool"

Switch back to the master branch, merge the working branch into the master branch, then delete the working branch:
$ git checkout master
$ git merge my-working-branch 
$ git branch -d my-working-branch
Tip: if you messed up your working branch and want to abandon it, skip the 'merge' step and use a capital "-D" when deleting the working-branch. 

Push your changes up to Github.com, and you're done! 
$ git push


_____ Update: if you're having problems with Gemfile.lock, try:
git reset HEAD -- Gemfile.lock
git checkout Gemfile.lock

Friday, January 25, 2013

Cheapest Jelly Bean Phone


Want a phone that has (or will have) Android Jelly Bean? They're still pretty expensive.  Looking at rough prices, for unlocked or no-contract devices:

Nexus 4: $300
Nexus 7: $200
Nexus 10: $400
Galaxy S III: $575
Galaxy S II: $420
S Advance: $300
Ace 2: $270
Ace Plus: $222
Galaxy Note: $520






Galaxy Note 2: $710
Galaxy Nexus: $460
Nexus S: $420
One X: $470
One X+: $650
Xperia T: $500
Xperia TX: $480
Xperia V: $500
Droid Razr M:
Razr HD: ?
Razr Maxx HD: ?
Atrix HD: $420
Electrify M:
Xoom: $325
Optimus LTE II: ?

More phones will eventually get the upgrade I'm sure, but right now it looks like the cheapest option is the Nexus 7, though it isn't a phone.  At least you'll get all the features of Jelly Bean.


Monday, September 27, 2010

Google Music in Gmail Chat?

Curious little bug in my Gmail.  When using the labs feature that shows an Android icon for friends who are on chat on Android phones...their name disappears.

The curious part:  hover your mouse over the name, and an "Invited" and a beamed note appears on the right...smells like a social music service is coming.

Wednesday, September 15, 2010

IE9 Beta - Battle of the "chrome"

Before Google's Chrome browser was released, "chrome" meant something different.  In browsers, it meant the borders and widgets around the web page itself.

I've heard a lot of chest thumping by Microsoft regarding how much IE9 gets out of the way.  So, I did a comparison of the chrome myself in the picture below.  Check out the red line I drew.

From left-to-right, the browsers are:


Guess what?  They're right.  Not only is more of the page visible, but also the title of the page and other controls have disappeared.  I am a dedicated Chrome user at the moment, but I may have to rethink my loyalty.

Tuesday, September 7, 2010

Import and Manage Your Photos

Here’s what to consider when choosing the right system for your personal photos.
This isn’t everything, but a good sample.
Three techniques:
Traditional
Sync
Cord-Cutter
Overall It stinks, but this is how most people do it today. Complicated and not adaptable, but if you can set it up then you can get the best of both worlds. Where most people will end up in the long run, but requires faith in Internet-based services.
Store Computer
Memory Card
External Hard Drive
Picasa + Picasaweb (pricing)
Live Mesh + Skydrive (25gb)
Windows Home Server
Dropbox
Facebook
Flickr
MobileMe
Picasaweb
Backup Mozy
Carbonite
Apple Time Capsule
Network attached storage
Amazon S3 connectors
Backupify
Local archive
Share Email attachments
Burn and mail a CD
Upload then share: Facebook, Flickr, Kodak Gallery
Picasaweb
Windows Live Spaces
Links, anywhere
Edit Adobe Photoshop
Apple iPhoto
Windows Live Photo Gallery
Picasa
Picnik
Photoshop Express
Aviary
Import Camera import software
Windows import tool
Same as Traditional Eye-fi card
Print Home printer
Costco
Wal-Mart
Walgreens
…local photo guy
Best of both worlds Picasa: Walgreens, Shutterfly, American Greetings
Flickr: Snapfish
…or download and upload to Costco, etc.

Tuesday, June 29, 2010

Amazon Down

Wow, you don't see that very often.

Wednesday, May 26, 2010

The Facebook Ultimatum

Summed up in a few words on Mark's blog post today....