Tag: branch

How do I file one Pull Request per Commit after making multiple Commits?

I’ve been working on a project and made good progress on several tasks. I have been careful enough to keep all my changes for each task on their own individual commits. Now, I want to issue pull requests for each commit individually, so there is only one commit per pull request. What is the best […]

git force checkout of duplicate branch?

If I want to create a new branch, I would do: git checkout -b new-branch However, sometimes this branch already exists, eg: fatal: A branch named ‘new-branch’ already exists. is there an easier way than doing the following? git branch -D new-branch git checkout -b new-branch I tried this but it doesn’t work: git checkout […]

Using feature, story and task branches?

We are using Visual Studio Team Services (VSTS) which have epics, features, stories and down to tasks. We will also follow git dmz flow in which development happens in feature branches. We want to use VSTS structure but not breaking the principles and benefits of git dmz flow. I was thinking of having a feature […]

Git merge doesn't merge a file the second time

I have a master branch with some stuff, let’s say file README. I also have a dev branch, child of master, with some additional files, let’s say file README2. I do the following: git merge dev from master and get the file README2 merged into master. Now I remove it: git rm README2 Now when […]

How can I check that a branch doesn't have any merges?

How can I check that a branch doesn’t have any merges? Specifically I think I want to check there are no merge commits between a given base commit and a given target commit. For example, I want to detect when either of these cases happens: target o /| o | \| o | base o […]

Pull from a Branch, and push to another

I have a ‘master’ branch, and a ‘bugfix’ branch. this bugfix branch needs to be always updated with master commits, but i need to push to its own branch. i tried git branch -f –track bugfix origin/master and tried set-upstream too but seems to set both, pull and push from/to ‘master’.

How to work with current working copy when moving to old branch in GIT?

I have a question concerning best practice in GIT. Imagine I create a branch called hotfixes and I add some fixes to it and then merge the branch with the master. Then I create a few other branches and merge them with the master. After a few weeks I realize I need to add some […]

Git – Multiple branches with different file systems

How to correctly organize multiple branches with each having different file system? Here is the situation – I have two branches: Current master with project files that were made a year ago Current develop with new project files (completely different framework) that is about to develop and at one moment switch The point where things […]

Why only push to a branch?

If we have three branches: master develop feature Where develop is used for CI, and feature is always branched from master… What reason could one have for only ever merging feature into develop without merging develop into feature first?

How to get the SHA of the base commit a branch is started from?

C E | / B D | / A How to get the SHA of the commit A if E is the current HEAD?

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