The more I use git, the more I find that it is not as bullet-proof as I have been led to believe. Though, so far, there seems to always be a way out of a problem. Such is the case when I was unable to update a local branch from our
Your configuration specifies to merge with the ref 'my_branch' from the remote, but no such ref was fetched.
No matter what I did to recreate my local branch, I could not pull from the remote. Google and StackOverflow was of no help—misdirecting to unhelpful information. It turned out that even through I’d fetched the current state of the remote server, my index was still showing a remote branch that did not really exist. Running the following command cleaned that up—and all was well:
$ git remote prune origin Pruning origin URL: git@github.….com:….git * [pruned] origin/my_branch $ _
For some reason there was a phantom remote branch that
fetch did not update in my local index, properly. Otherwise
prune is pretty innocuous, so it might be worth running, every once-in-a-while to make sure that your index is an accurate reflection of the remote.
git is has become one of the most popular source code control tools on the planet. Even if you’re coming from another source control system, becoming proficient with git can take some time. The best place to start is by running through the git Tutorial. Before that, you might take a look at the GitGuys article to get a quick synopsis of git concepts. Also, though slightly out of date, keeping the following diagram in front of you will help as well. It shows the git command-line commands that “move” file changes from one place to another in the git data-store hierarchy. Read the rest of this entry »
As I mentioned in my prior post OS X Command-line Dev Tools—Install Shortcut, OS X comes with a variety of built-in tools suited for developers. Unfortunately, Apple has seen fit to hide one of the most important of them: the web server. Despite that, they are easily unlocked if you know how. This applies to Mountain Lion (10.8) and (though I haven’t tried it, yet) Mavericks (10.9). Though you can install separate installations, I don’t like to install anything extra, unless I must. Read the rest of this entry »
I use the command line a lot, even though I am on a graphical user-interface like Windows or OSX. And since I’m lazy, I write a lot of scripts to perform repetitive tasks. The downside of command-line is that there is no standard way to interact with GUI features. I stumbled across a command in OSX, recently that allows command line programs to copy/paste between the clipboard that we’re so used to using.
OSX has two commands,
pbcopy, Read the rest of this entry »
Github has become the place to manage source code—it’s free, robust, and commonly accessible. Github repositories are owned and access to change them must be enabled by the owner. Still, you can make changes to a Github repository; but a “pull request” must be sent to contributors of the repository and they can accept the change at their discretion. Keeping changes in sync when you don’t have direct change privileges may not be obvious.
One-time Github Changes Read the rest of this entry »
See the example code at: http://cachecrew.com/sample_code/highlight_file.php and http://cachecrew.com//sample_code/highlight_file2.php.
The PHP and HTML Read the rest of this entry »
Among those around me, in world of tech startups (even in the vicinity of the world of Windows), MacBooks are used almost universally. I can’t explain the discrepancy between what I see around me and the data you usually read; but I do know that as a technical platform, OS X provides an easier path to development tools. These days, the world driven by web-based applications. A majority of those applications run on Linux-based machines. OS X shares with Linux, a common ancestor, Unix. So, a robust array of common commands come with OS X—
emacs, etc. But more importantly, OS X comes pre-installed with hottest development tools used for web development, today—Ruby, Python, PHP, Apache, memcache, etc. This means a developer can write web applications without even being connected to the Internet!
It is surprising how quickly we forget how to use scripts we had written, let alone, what they were for. So it is even more difficult for others to know how and whether to use your script. You can avoid wasting the efforts you put into the problems you solved with your script by simply adding some friendly “help” output.
Here is some basic information you should include:
- Summary description
- Form of use—basic syntactic usage
- Description of usage syntax; i.e., input parameters
- More detailed information, if necessary. Read the rest of this entry »