Tag: branch

Set remote branch to a commit we don't have locally

Some intern did a force push on master yesterday. After we’ve done scolding, 😉 we looked at the result. Luckily, we had an almost up to date version of the master on one machine, only some pull requests have to be merged again. But one thing is bugging me: We found the old HEAD commit […]

Must every git commit be an ancestor of a branch?

Given this git tree: A <— B <— C (HEAD, master) is it possible to put the tree into this state: A <— B (HEAD, master) <— C (There are no branches or tags other than master.) In other words, can a commit (C) exist without either being a commit pointed to by a branch […]

Git Workflow for continuous development

We’ve been using Git for a node.js based web application. Our workflow is based on two brances, master and stable. We use master as the main development line and when we decide to release something, we go ahead and merge master into stable. There are two servers, “staging” and “production”, whenever we push, a post […]

How to pick a commit in sub-branch and merge it into main branch?

So I have: master +commit1 +commit2 +commit3 myBranch +commitA +commitB +commitC I want to pick commitB in myBranch and merge it to master branch, what should I do?

when merging git branch, how to avoid the commits logs in a branch?

if another developer branches out on branch DEVELOPER_A, and makes a lot of commits on that branch, when he’s done, I want to merge his work onto master. but I don’t want all his small commits to show up on the master branch history, and only care about the last commit. so is there a […]

Git branch vs commit

I have master branch where i commited my last change now i run git branch test checkout test i deleted file README in the project folder then i run git checkout master and there is no README file anymore. I thought when you create new branch its like creating new commit?

Can I do a real git merge without having to push the commit messages from the branch to master?

I’m merging changes from a stable branch back onto the development branch. I want it to be a “real” merge, by which I mean it should show a merge when I do git –graph –oneline. The catch is, I don’t want to commit all the messages from the branch, but just my merge commit message. […]

Rebase and changing branch is including all merged commits in pull request

I’m coming from a SVN background. I’ve forked and branched a git repository. Then I changed the branch (let’s call it my-branch), committed, pushed and sent a Pull Request. It happens that the upstream repository has been changed and my PR became invalid due to conflicts generated by the master changes. How should I proceed […]

Git push trying to push to different branch even though tracked

I’ve got a git repo setup with 4 branches: master dev johndev angular-routing I’m currently working on angular-routing and tried pushing to origin/angular-routing with simply git push which worked, but I noticed that I got the following error: ! [rejected] johndev -> johndev (non-fast-forward) I get what the error means, that’s fine, but I don’t […]

Git : Make the same edits on two different branches at the same time

I would like to know if it’s possible to work on two branches simultaneously if I want to write code that is supposed to be in those two branches. So that, if I commit my changes, it actually updates both branches. For example : The code in my branch A is this print “I like […]

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