This warning: “remote HEAD refers to nonexistent ref, unable to checkout.” happened to me today and since it was an odd enough warning (I’ve never seen it before in all my years of work with git) I thought it’s worth describing the situation here and how I solved it. I cloned a remote git repository […]
version control system
How to create a brand new git tracking branch (from scratch)?
There’s tons of advice on the web on how to setup a new local branch that tracks and existing remote branch. But what I was looking to do is create a brand new branch (i.e. not yet present neither on hte server nor on your workstation) and have it be a tracking branch. After lots […]
Git remote branches: how to create, track, remove/delete
1. Here’s how to to create a remote branch in git:: git push origin origin:refs/heads/my_branch … or even simpler and more straightforward: git branch my_branch # create branch locally git push origin my_branch # push it to server 2. To push your changes to the remote branch: git push origin my_branch 3. To delete the […]
How to move a branch in git?
“Moving a branch” may mean two things: 1. Move the contents (the commits, the changes) associated with a branch name somewhere else in the repository. 2. Move the branch name (not the code changes!) to point to some other commit. Let’s examine the two possibilities in detail: 1. Move branch contents and name: This case […]