Tag: branch

git push branch without merge

I have one branch master on the server (remote). I created new local branch that doesn’t exist on the remote (server). How can I add (push) the branch to the remote (server) without merging it with the master branch

Git: Check out a branch keeping uncommitted changes

In Git, how would I check out an older branch while preserving all my changes from the current branch, but they would just be marked as uncommitted changes or new files. Is there a command like git checkout-but-keep-changes branch_name?

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 $ […]

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