Tag: branch

How do I force git to always use the master branch?

I have some Xcode project I’m trying to clone from GitHub using git, and it has external submodules as well. Whenever I try to clone, it keeps putting these external submodules as well as every folder in the project on “(no branch)” instead of master. This is what I’m doing in Terminal: git clone git@github.com:******.git […]

git newbie error – how to recover

Possibly related to Git – pulling changes from clone back onto the master I was working on an ASP.NET project when I discovered I needed to make an “experimental” set of changes which may or may not have been required in the production version. The obvious thing to do was to create a branch. However […]

How can I add a new file to my Git repository?

I’m creating some new files and am trying to add them but when I use git add applications/libraries/calendarclass.php, it won’t recognize that I have a file there I just created that file in textmate and am staring at it. How do I add it to git? releventz$ git add application/libraries/calendarclass.php fatal: pathspec ‘application/libraries/calendarclass.php’ did not […]

Converting hg bookmarks to named branches

After migrating from git to mercurial (not my personal preference 🙂 I have faced a problem: hg convert converts git branches to bookmarks. Is there a way to convert the bookmarks to named hg branches? Is it even required or not, and why? Thank you!

How can I retrieve commits in “overwritten” branch in Git?

Background I’m working with just one branch – master. 3———2——— | 6——-5———4———1———- I made commits 1-3, then realised I wanted to work from commit 1 for the next section of work. I checked out commit 1, then made commits 4-6. Ooops. Commit 3 contains some important information I need. The Problem When I do a […]

No branches in SourceTree?

I have a project on my PC, I want to host it on BitBucket as a Git repo. I’ve been using SourceTree to manage an existing project with other contributors, so I know the basics about modifying a repository, but I haven’t made my own one before. What I’ve done so far was make a […]

How to create a branch under another branch in git?

I’m just curious, because I’ve noticed that some repositories have their branches setup like this: git branch -a master remotes/origin/branch1 remotes/origin/branch2/lala remotes/origin/branch2/yay remotes/origin/branch3 remotes/origin/branch4 I’m just curious how they do the branch lala and yay under branch2; or is that not a branch? Any insight?

When I checkout a branch in GIT and then tag without explicity specifying the branch name what happens?

A very simple question I hope… but deceptively difficult to get a straight answer from the documentation or playing around on the command line in GIT. Here is the scenario, I have a local repo and am in master. I create a branch called branch1, I checkout branch1. I then make some change, add / […]

Separate git branch into multiple branches to merge to master

My team has been working in a prototype branch off of master. I now want to take that work, slice it up into different “feature branches”, and merge them individually into master. I see a couple ways to do this, neither of which I really like: 1 – Create a new branch, Feature_1, off of […]

Does git know which branch is which after a merge?

Sorry if this is a stupid question with just a yes/no answer, but if I understand correctly, in git a branch is just a pointer to a commit. Doesn’t this imply that once you’ve merged two branches, git doesn’t know which one pointed to which set of commits? Before A—B—C—D—E <- X \ 1—-2—-3—-4 <- […]

Git Baby is a git and github fan, let's start git clone.