How to Tag and Push a Release with Git
Set the `-a` and the `-m` flags like so git tag -a v1.0.0 -m "Note about the release goes here" Then to push the tag to a repository git push origin --tags And that's it! Here are the docs [https://git-scm.com/book/en/v2/Git-Basics-Tag...
Written by Sean Behan on 11/29/2017
Changing GitHub Issue State in Git Commit Message
Changing issue state in git commit message for Github issues fixes #xxx fixed #xxx fix #xxx closes #xxx close #xxx closed #xxx Example git commit -am'complete bug fix closes #123'
Written by Sean Behan on 06/17/2012
How to Recover a Mistakenly Deleted Branch
Workflow git checkout -b _new_branch_name # do some work and commit changed git checkout master git branch -d _new_branch_name # doh... i meant to merge first Fortunately, you can easily recover from this mistake. git reflog 395b1ea HEAD@{0}: checkout...
Written by Sean Behan on 06/17/2012
Git Feature Branch Naming Strategy
There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton Typically, we have three main branches at any given time in a project lifecycle. master, development and staging. Master is production ready code, d...
Written by Sean Behan on 06/17/2012
My First Ruby Gem: Hashed_Attributes
I just wrote and released my first Ruby Gem, Hashed Attributes https://rubygems.org/gems/hashed_attributes. It is a very simple ActiveRecord extension for saving variables through a serialized hash. The Gem will let you declare getter and setter methods t...
Written by Sean Behan on 06/17/2012
Git Untrack Already Tracked Files
To remove files that are currently being tracked by git, you have to remove them from the "cache". Note, doing this will NOT delete the file on your local machine. It will still be there but not be tracked. git rm -r --cached supersecretpasswords.txt Yo...
Written by Sean Behan on 06/17/2012
Git: How to Delete a Branch with an Invalid Name
If you've named a branch beginning with two dashes "--", you're sort of in trouble because git interprets your branch name as a switch/flag. You can skip switches all together by supplying two dashes before your branch name git branch -d -- --index_for_...
Written by Sean Behan on 06/17/2012
Installing Ruby on Rails 3, MySQL, Git, Ruby Enterprise Edition, Passenger (Mod_Rails) on Ubuntu with Rackspace Cloud.
Short and sweet. Here all the commands I run in this order to set up a brand new box. It usually takes about 10 - 15 minutes on a 256 MB RAM instance. Compiling Ruby Enterprise Edition, which is super easy, will take the most amount of time. It will seem ...
Written by Sean Behan on 06/17/2012
How to Remove Your Last Git Commit
Remove your last commit (if you haven't pushed yet) git reset --hard HEAD~1 To see changes that have been committed and their position in HEAD git reflog And to undo your previous reset and advance the cursor to the reference immediately behind the cu...
Written by Sean Behan on 06/17/2012
Have Git Email Committers After Pushes
You need a Mail Transfer Agent MTA on the server. The easiest way is to install Sendmail, which Git uses by default. apt-get install sendmail Remember that /etc/hosts file needs the ip address to map to the domain name your sending mail from # vim /et...
Written by Sean Behan on 06/17/2012
Very Basic Git Workflow
Very, very basic git workflow git pull git branch dev_branch git checkout dev_branch #make some changes git checkout master git merge dev_branch git branch -d branch_to_delete git push
Written by Sean Behan on 06/17/2012
Working with Branches in Git
Show all the branches git branch Create a new branch git branch my_experimental_feature Use that branch git checkout my_experimental_feature Pushing the new branch to a remote server git push origin my_experimental_feature Pulling that branch down...
Written by Sean Behan on 06/17/2012
Non Standard Port Number with SSH and Git
Here is an example using the port 4567 to connect with over ssh and git ssh remote add origin ssh://sean@seanbehan.com:4567/path/to/git git push origin master
Written by Sean Behan on 06/17/2012
git checkout -- file-in-question.oh-my
Problem: using git and one file, like your db/schema.rb, is out of whack with the latest branch. If you run git pull and you get a failed merge and no update. You can of course, edit the conflicts manually. But what if you're confident that the latest sch...
Written by Sean Behan on 06/17/2012
Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git
Here are a list of commands to get up and running with Apache2 with Phussion Passenger for Rails, PHP5, MySQL5, Ruby on Rails with Gems, and the source control software Git. I think that this is a pretty ideal environment for a development box and even pr...
Written by Sean Behan on 06/17/2012