Tag: git branch

Git – replace local branch with remote branch

I know this question has been asked but I can’t seem to completely replace my local branch with my remote branch. I had installed a 3rd party plugin in my local branch and am having trouble removing the installation; thus, I want to “start over” with the remote version of the branch. The branch is […]

git delete remote branch not working: branch not found

I am trying to delete a remote branch in git, I did: git branch -r … origin/master origin/dev origin/branch_to_delete now I try to delete origin/branch_to_delete: git branch -d origin/branch_to_delete error: branch ‘origin/branch_to_delete’ not found I did: git fetch –all and tried again, the same error. I tried with -D but the same error. but the […]

What happens in the child branch if I delete a parent branch in git

I am planning to rename a branch in my git repository. I found out that the easy way to do that is to make a new branch from that branch and give it the desired name. After that I want to delete the old branch (the parent). But I’m afraid that I will lose data […]

Git rebase from one branch to another

I have the following case : K—L new-feature / H—I—J dev-team1 / E—F—G dev-main / A—B—C—D master And I want to move only the new-feature (K—L) branch in dev-main branch without (H—I—J) form dev-team1 H—I—J dev-team1 / E—F—G—K—L dev-main / A—B—C—D master

Should I merge master into a feature branch to bring it up to date? Would this be considered bad practice?

I have a situation like this: (master) A – B – E – F \ C – D (feature-x) Should I merge master into feature-x if I need critical fixes E and F into the feature-x branch to continue development and I intend to merge back into master? Is there any disadvantage to repeated merging […]

Diff branches in Atlassian Stash

I am trying to get a diff between two branches in stash. Specially before sending the pull request, wanted to verify the changes. have been reading many articles trying to figure out a solution but haven’t succeeded yet. here are the articles I have looked into: Git diff against a stash Compare and Diff for […]

How to ignore some branches/tags being copied to local git when do git fetch –all

I have many remotes added to my git. Each remote is a repository for one developer. Every day I fetch –all to see any new branches they create that are ready to review. However, developers can push “private” branches to the remote. Say, all branches named with a underscore prefix are not ready to review, […]

Pushing fails – Empty repository at remote server with GitKraken

I have found Gitkraken a few days ago and was playing with it a bit. I came to a point where I did not found any useful informations on the internet or the gitkraken faq about my question anymore. I have the following case: Local repository with 2 branches develop & master Gitlab server where […]

How to commit and push changes using Git

I just want to clarify how committing on specific branches works. Let’s say I am working on a branch called “Metro”. I make some changes to a few files, but I am not ready to push these up to the remote repository. A hotfix comes in that I need to fix asap. I need to […]

Find first common child of two commits

: A T / \ i B C m : : e D E \ / | F V : git merge-base B E allows to find where a the common ancestor A of the two commits. Is there a way to find the commit F where the two branches are merged again?

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