Tag: branch

How to move git commits from master to a different existing branch

This question already has an answer here: Move the most recent commit(s) to a new branch with Git 8 answers In git, how do I remove a commit from one branch and apply it to a different branch? 2 answers

Will a commit be garbage collected if it's referred to by tag but not by branch?

I’ve got an annotated tag referring to a commit (does it matter if it is annotated?) and no branch referring there. Will the commit be garbage collected after some time?

How can I translate trunk/branch concepts from Subversion to Git?

So I am not much of a source control expert, I’ve used Subversion for projects in the past. I have to use Git for a particular project (client supplied Git repo). My workflow is as such that I will be working on the files from two different computers, and often I need to check in […]

How do I split up a large Git branch into lots of smaller branches?

I have imported from SVN into Git, now I have one big branch, like this: work on feature C work on feature B work on feature C work on feature C work on feature B work on feature A I want separate feature branches, for A, B, C. I’m cherry picking commits to new branches […]

Applying the changes from branch b to a, without merging or adding commits

My scenario is that I have one branch in which I’ve made big improvements to the build process (branch A) and in another I’m working on a unrelated feature (branch B). So now when I’m hacking away at branch B, I want to pull in the stuff I wrote in branch A because I want […]

Copy 1 commit from one branch (dev) to another (stable) with clean working dir

I tried to understand How to undo a commit and commit the changes into the other branch in Git? but I don’t think it has to be that hard. (Answer is using branch -f and stash and I don’t think I need those.) I was working in my dev branch. Had two different commits in […]

Git workflow – changing branch and slow recompiles

I work on a large Scala project where we use Git for version control. My workflow is to work on new features in my own branch and switch when needed. Various releases of the code are in their own branches. All very standard. If I have to fix a bug in a certain version of […]

How to run git commands on remote without having local repo

I have a script called ‘git–export‘ which helps me to export a remote repository. It is run like that: git-export http://host.com/git-repo <-t tag or -b branch or -c commit> /local/dir Before it was used to export local repository and I used these commands: to get commit from branch: git branch -v –no-abbrev|awk ‘($1==”‘$BRANCH'”) || ($1 […]

Git: how to revert a branch merge without overwriting history?

I have two branches: master and opengl. I recently finished implementation (or at least I thought so) of opengl branch and decided to merge it into master: git checkout master git merge opengl git push After I did this, several developers who are working on the master branch pulled my changes and it turned out […]

committing to the same branch with git

Let’s say that there are two people working on a git branch, they check out at the same time but one of them commits first and then the other commits after. Will the newest commit still be merged with the former commit or can multiple people work on the same branch simultaneously?

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