Browsing all articles in Programming

“warning: updating the current branch” when pushing to a git repository

Posted Posted by Wes in Version Control     Comments No comments
Mar
8

I pushed some changes after updating git on my server to git 1.6+ and now I get this:

$ git push origin master
...
warning: updating the current branch
warning: Updating the currently checked out branch may cause confusion,
warning: as the index and work tree do not reflect changes that are in HEAD.
warning: As a result, you may see the changes you just pushed into it
warning: reverted when you run 'git diff' over there, and you may want
warning: to run 'git reset --hard' before starting to work to recover.
warning:
warning: You can set 'receive.denyCurrentBranch' configuration variable to
warning: 'refuse' in the remote repository to forbid pushing into its
warning: current branch.
warning: To allow pushing into the current branch, you can set it to 'ignore';
warning: but this is not recommended unless you arranged to update its work
warning: tree to match what you pushed in some other way.
warning:
warning: To squelch this message, you can set it to 'warn'.
warning:
warning: Note that the default will change in a future version of git
warning: to refuse updating the current branch unless you have the
warning: configuration variable set to either 'ignore' or 'warn'.

Woah! After some research, this is because I didn’t set up my remote folder as “bare”. A non-bare repository has a working copy attached to it, and this warning is telling you that said working copy exists and is currently checked out to the branch you’re trying to push to.

This is bad, because if you were pushing to a co-worker’s machine, then when they go to commit or run a diff, things will go awry. In this case, I just didn’t set up the repository correctly (it was the first one I’d done!) so I wasn’t in danger of losing anything.

The fix is to use --bare:
git init --bare or git clone --bare

Installing sqlite headers on ubuntu (sqlite3.h not found)

Posted Posted by Wes in Ruby, Ruby on Rails     Comments No comments
Mar
5

I was setting up Integrity for the first time and ran into this on my server when bundling gems:

~$ bundle install
...
Installing do_sqlite3 (0.10.0) from rubygems repository at
  http://gemcutter.org/ with native extensions
  /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:482:in
  `build_extensions':
ERROR: Failed to build gem native extension.
  (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby1.8 extconf.rb
checking for sqlite3.h... no
*** extconf.rb failed ***
...

The key is the line: checking for sqlite3.h... no
The do_sqlite3 gem gets compiled natively, but the development headers weren’t installed on the system and so the compilation won’t work.

Install them:

~$ sudo apt-get install sqlite3
~$ sudo apt-get install libsqlite3-dev

Then, re-bundle:

~$ bundle install

Kansas City Ruby User Group: Kyle J Ginavan on Progressive Enhancement

Posted Posted by Wes in Kansas City Ruby User Group, Ruby, Ruby on Rails, Videos     Comments No comments
Feb
12

Presentation: Kyle Ginivan on Progressive Enhancement

Progressive enhancement is a strategy for web design that emphasizes accessibility, semantic markup, and external stylesheet and scripting technologies. Progressive enhancement uses web technologies in a layered fashion that allows everyone to access the basic content and functionality of a web page, using any browser or Internet connection, while also providing those with better bandwidth or more advanced browser software an enhanced version of the page.
read more

Capistrano deploy error "fatal: unable to create '.git/index.lock': File exists"

Posted Posted by Wes in Ruby on Rails, Version Control     Comments No comments
Oct
21

This isn’t specific to capistrano, necessarily, but I ran into it deploying.

fatal: unable to create '.git/index.lock': File exists
read more

Announcing: Lowdown, a Cucumber feature editing webapp

Posted Posted by Wes in Ruby on Rails     Comments No comments
Aug
25

An original application completed for Rails Rumble 2009.

Lowdown helps keep your development project on track by helping developers, designers, project managers and owners all focus on satisfying stakeholders.

Built along with Sean Cribbs + Scotty Moon + Paul du Coudray

While leading the competition after judges’ voting ended, we slipped to 4th place after public voting and ended up taking the “Best Appearance” category, which is fantastic.

git: You asked me to pull without telling me which branch …

Posted Posted by Wes in Version Control     Comments No comments
Jul
1

Received this error when trying to pull from a remote origin:

You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.

read more

git: failed to push some refs

Posted Posted by Wes in Programming, Version Control     Comments No comments
Jun
26

I’m really digging git, but its error messages are less than helpful at times.

git push origin master
error: failed to push some refs to origin

Most likely, there are changes in the remote repo that you need to pull first:

git pull origin master

Resolve any conflicts, then you can push to the remote git repo.

I’m not sure why “failed to push some refs” couldn’t include “(do you need to pull?)”

Remove ERB files after upgrading to haml

Posted Posted by Wes in Ruby on Rails     Comments No comments
Jun
10

I converted an application to haml and wanted to get rid of my previous ERb templates.
read more

Clearing a stuck POP mailbox with Ruby Net::Telnet

Posted Posted by Wes in Ruby     Comments No comments
May
18

A client’s mailbox was full. Outlook tried to download all messages before deleting them, and I don’t know a setting to make it retrieve/delete a set number.
read more

blog Categories

about databasically

We live and work in Kansas City, USA.

We're passionate about helping small businesses succeed and want to help you use technology to get more done.

From server, desktop, network management to programming custom web applications in Ruby on Rails, we're here to lend a hand.

Contact us if you have any questions!