Tag: branch

How do I fix the fact that I'm working on the wrong branch

Ok so I meant to be working on a branch called directory-layout, but it turns out that I am working on a branch called master. This is a problem. I have not yet performed git add . nor git commit -m “I’ve made a horrendus mistake I’m sorry” What do I do to add my […]

Git change branch, but don't change files in workspace

This is similar to my another question ( Switch to another branch without changing the workspace files ) but solution that worked there, doesn’t work now. I needed to remove some changes, which were long time ago pushed to remote master. So I don’t want to remove commits from master, but I want to change […]

Is there an inverse to Git's octopus merge?

Git has a much-touted(?) octopus-merge capability that can merge many heads into one. But is there something that would do just the opposite, make several simultaneous branches out of one node? Let’s assume that I have a bunch of code for a project, and I just started using Git. Some of the features are complete […]

How can I recover a commit to an unnamed branch in Git?

I did some changes and then did a commit. Then I realized that I am on an unnamed branch. So I checked out another branch (with a name). Now I want to recover the commit that I did to the unnamed branch or switch back to the unnamed branch so that I can put a […]

git / gerrit prevent develop branch to be merged into stable / testing branch

Using Gerrit it is easy to accidentally merge unstable code from the develop branch into the stable branch: $ git checkout develop $ commit $ git push origin HEAD:refs/for/stable In Gerrit it isn’t very clear that the proposed change comes from the develop branch and is to be merged into the stable branch. Is there […]

git merge with –no-ff and –squash

I am using the git flow way of managing branches in my repo, as described in: http://nvie.com/posts/a-successful-git-branching-model/ Thus the sequence of commands I should use would be as follows: git checkout mybranch git pull –rebase origin develop git checkout develop git merge –no-ff mybranch However, there is one thing that I would like to do […]

Can I influence the merge strategy used by “recursive” when applying a git stash?

I have a set of debug utilities living in a git stash slot; I’m moving between branches which differ only very slightly regarding the changes in the stash. I git stash apply the top stash on the respective branch to test a feature. However I ran into a proper merge conflict in one of the […]

Why do I have problems pushing new branches to my Git repository?

As a followup to my question about unavailable branches after svn to git migration, I have a different problem: I’m unable to push new branches to my central Git repository. $ git clone ssh://server/opt/git/our_app.git $ cd our_app $ git branch my-test-branch $ git checkout my-test-branch $ echo test > test.txt $ git add test.txt $ […]

Can't push branch to github “Use git@github.com:Paratron/spacebattles.git”

I have a working branch in my Mac names database and I would like to push this branch to GitHub and have tried to do this by running: git push -u origin database And get the following error message: You can’t push to git://github.com/Paratron/spacebattles.git Use git@github.com:Paratron/spacebattles.git Are there known issues that could be the cause […]

How can I label my current git branch as ok then continue

I am in the middle of work on a branch. I’ve reached a “works so far” point. I want to clearly label my current state with a label, e.g. “ok_so_far”. So that when I continue and if (… ok when) I mess up I can get back to this point easily. I know I can […]

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