git: what to do if you commit to no branch
Using git, you'll sometimes find that you're not on any branch. This usually happens when you're us
Having recently made the switch from svn to git, I wanted to achieve what svn externals did (and what Piston did better). Turns out this is pretty simple, for example to get rails on edge:
A couple of other default submodules you'll want:
What submodule does is to check out the submodules as their own repositories, so they are tracked independently of the repository you made them submodules of. The submodules you have are tracked in the .gitmodules file, which might look something like this:
Or at least that's how it should look, Windows seems to mess this up into looking something like the following:
Note especially that you need to remove the 's and replace all 's with /'s. If you don't git will give a fail message like:
I don't know why it's doing that, maybe it's something I'm doing wrong but you'll need to tidy it up to make it look more like the first example in order for it to work properly.
One final thing to be aware of is that when you clone onto a new machine you'll need to run the following commands:
This will initialise the submodules that are referenced in the .gitmodules file, then pull them down. By default cloning doesn't seem to do that.
For a deeper understanding of common Git issues, the post When Git tells you it failed to push some refs offers insights into resolving the "non-fast forward" error. Additionally, you might find git: what to do if you commit to no branch helpful as it addresses handling the "detached HEAD" state in Git, frequently encountered when working with submodules.
Using git, you'll sometimes find that you're not on any branch. This usually happens when you're us
A lot of what we do in Rails boils down to simple Crud. If you're in the habit of developing admin
One of the things I really loved about Rails in the early days was that it introduced me to the conc
I received an unhelpful error while trying to push to a repository on Github today: git push To git