Tag: git branch

Pushing one git branch requires a pull on another?

I’m a bit of a git n00b, and I am having some difficulty with branches. I don’t think this question has been asked, however it could just be that I’m not looking for the right keywords. Situation: I have a remote git repository and I have checked out the master branch on machine 1. I […]

what are “automerged” files in git, and how do you list them all?

I ran a git merge master –no-commit in a branch and the only output given was this: Auto-merging path/to/file Automatic Merge went well; stopped before committing as requested However, git diff HEAD –name-status shows that there are about 15 files that where modified (prefixed with ‘M’) and 3 files which were added (prefixed with ‘A’). […]

Git – Making Changes to Multiple Master Branches

My small group of developers creates and maintains interfaces to several different versions of our company’s core product. The different versions of our core product are mostly similar, but there are some differences which require us to keep our code in a separate branch for each version. Everything is in the same repository. We were […]

When is it safe to rewrite git history when local branches are present?

I am learning git. In this book I read that rebase is not safe when I pushed commits into public repository. It is clear. But what if I didn’t pushed commit-X, but created local branches After commit-X are made and want to change this commit? I tried to change name of the old commit in […]

Can I work on a branch with patches merged from another branches?

I’m not exactly sure what this is called or if it’s a bad idea, so please educate me if I’m going about asking the wrong question. I have a codebase that I’m helping to improve which I’ve cloned from github. I wanted to start by cleaning up some of the obvious warnings being reported by […]

git master branch should be synched with which environment…?

Current Process Flow : Currently i am having four git branches Master, prod, stage and dev. The commit goes in this order, all the development commits goes to the dev branch at the end of each sprint or ticket all the dev commits will be manually merged to a release branch by the respective developers […]

How to programmatically configure a Git branch's description?

The git branch –edit-description command opens a text editor for the user to manually enter the description of Git’s current branch. What I am after is something like: git config branch.my_branch.description < <(fmt –width=72 <<MY_DESCRIPTION Subject (50 chars max) Intro (one sentence, line wraps after 72 chars) Description (multiple paragraphs, line wraps after 72 chars) […]

List all local commits in the current branch that have not been pushed to remote for Git tool

I am creating a simple git viewer in PHP and I need a way to list and count all the commits that have not been pushed to my Bitbucket account from the current branch. I tried using: git cherry -v This does give me a list of commits, but the list contains both pushed and […]

Git push from a previous commit

I have several commit in a branch, but I notice that there was something wrong so I return (checkout) to a previous commit, and made some changes and now everything is fine. But the problem is that I am not able to push because git want me to pull first, but I don’t want to, […]

Automatically rebase only when pulling from upstream branch

Let’s say I have two remotes: parent (not called upstream here to avoid confusion) and origin (fork of parent) and the master branch has origin/master as upstream, so that I can pull from parent/master and origin/master and only push to origin/master. It seems reasonable to want pulls from origin/upstream to use rebase (since any commits […]

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