All Questions
126 questions
-1
votes
1
answer
42
views
How to merge the changes from one branch to another branch in git
I have created two branches from master branch. I have made some changes in the second branch. I am trying to pull the changes from second branch2 to first branch. I do not know how to merge the ...
1
vote
1
answer
44
views
How to merge the master branch commits to feature branch after revoking all the feature branch related commits?
I have a scenario where there is a master branch, and a feature branch is cut from the master branch.
Master branch
Feature branch
all our custom changes to the code are committed to the feature ...
1
vote
0
answers
43
views
Lowest storage way to create a domain branch with clean history?
How can I create a new domain branch without duplicating revision history? By domain branch, I mean something like "mac", "windows", "serialization", configuration, or ...
0
votes
0
answers
87
views
Git merge not up to date
I started using gitlab only recently and right now my project has 2 branches. I want to merge branch A into B, both are up to date with their respective origins but after the merge it looks like the ...
0
votes
1
answer
36
views
Is it possible to replace merged files in one directory with redundant merged files from another directory in git?
I am still fairly new to Git, however I am trying to correct some of the very poor file structure I created previously and am unsure how.
Essentially what we have is this structure:
--original_folder
...
0
votes
0
answers
82
views
Git Merge - Question related to local vs remote repository and how it could affect the master branch?
I'm pretty new with using Git and I am trying to understand the git merge function a bit better. Hope someone can explain this to me, I would appreciate it!
So, I'm working on a local testing branch ...
0
votes
2
answers
61
views
Does merging a branch into both A and B, then merging B into A create issues?
I have a branch that holds a few small changes, which we merged into the Development branch a couple days ago. Now, we wanted to bring those changes to Master, but we're worried this will become a ...
0
votes
0
answers
265
views
How to find the parent branch name of a merge commit in git?
As asked in the title, how do I find the parent branch name (not parent commit) of a merge commit? Thanks.
0
votes
0
answers
41
views
I merged two branches but reverted that merge again. I tried to merge again but it says already up to date, however the files are totally different [duplicate]
Merged one branch into my branch, but I reverted that merge.
I merged again by
git checkout branch1
git merge branch2
but it says already up to date, however, I don't see any changes in my branch. It ...
0
votes
0
answers
255
views
Auto merge master branch into staging branch, whenever there are any changes made in master branch
I have two branches Master and Staging. Whenever a PR is merged or any other changes are done into Master branch directly, then I need to merge Master branch back to Staging branch automatically.
Is ...
2
votes
0
answers
2k
views
why git merge operation is not showing in git log?
I'm new to git. I've done some simple operations:
create a repo
add an file 'A' into the local repo, then stage, commit and push to the master branch (commit1)
create a branch by running git checkout -...
0
votes
1
answer
394
views
Best way to add new features to a project with GitHub
I have recently launched my first GitHub open source project. Now I would like to add some new features to this project in a beta branch before merging with the master.
But what is the most efficient ...
0
votes
1
answer
232
views
Git Workflow short-lived feature branch with squash
I have a questions concerned about the following git workflow:
- checkout master
- pull -r origin master
- checkout new_feature
- rebase master
- checkout master
- merge --squash new_feature
- ...
1
vote
1
answer
4k
views
How to merge main and master branches?
I created a git repo about a month ago where the main branch was called 'master'. A couple days ago when I tried to commit and push to the same repo it pushed my changes to the 'master' branch, but I ...
0
votes
1
answer
284
views
Find which git branches have been merged to branch x, but are not yet in master?
I have a branch "UAT" which several feature branches will be merged into for testing. How can I get a list of the branches currently merged into "UAT" which are NOT yet merged to ...
0
votes
1
answer
233
views
Is it a to merge dev into release-branch prior to merging release-branch back to dev?
We're using something a kin to git flow at my place. It's soon time to merge our release branch back into dev. My plan is to create a pull request to merge our release-branch back into dev so that the ...
2
votes
2
answers
93
views
How to create new branch with with previous changes, current changes and new file from another branch?
I have following files in my directory, let's say
helloworld.go
index.html
main.js
These all are latest commit of branch validation.
Now I want to create a new branch which contains,
helloworld.go &...
0
votes
1
answer
895
views
Your branch and origin/master have diverged
I know others have asked this question but I want to understand what it means.I am still learning git.
I was on the branch sample-tests
I did the following :
git checkout master- I switched to master ...
2
votes
1
answer
2k
views
How to have branch specific variables in GIT and python
I have 2 different branches, master and test. Those branches are exact replicas except for the database string which is different for master and test. Everytime I merge test to master, the database ...
1
vote
1
answer
1k
views
how to resolve diverge in git?
I'm having troubles to resolve a problem I have on my working copy:
earlier I pulled and it auto-merged a couple of files, they showed then up in the staged area from where I did not commit. I ...
5
votes
2
answers
294
views
Merge from trunk to branch but only files in the branch
I have branched off trunk to a feature branch. In order to keep my branch up to date, I would like to frequently merge back from trunk (always up to date), but I don't like everything in trunk getting ...
0
votes
0
answers
97
views
Git branches borked, dev somehow no longer child of master -- where to start?
My repo is straightforward: master, with a dev branch, and an exp branch off of dev. Sometimes when I do what seems like a plain-vanilla merge, git still requires an extra commit, along with the token ...
5
votes
1
answer
2k
views
Why are git commits on a merged branch showing on my main branch?
I currently have a git commit tree that looks something like this with pointers (?) in parentheses:
* 305f Merge branch 'develop' (HEAD->master, origin/master, origin/HEAD)
|\
| * d97b Some ...
1
vote
1
answer
54
views
How would I git merge two of the same projects that have an original ancestor but diverged?
I have a project (effectively a folder with a bunch of files).
Say I have a main release that is now on version 5.2.
Back when it was on version 3.0, I duplicated the folder and began working on a ...
-2
votes
1
answer
178
views
Git behaviour when merging
I have a project with a source branch - Branch1 and two branches which I have sourced from Branch1, say Branch2 and Branch3.
I delete a file in Branch2 and ask it to be merged to Branch1. It gets ...
4
votes
1
answer
7k
views
Gitlab merge from a specific source branch
I have a branch in gitlab called devops and i want to merge my master branch with devops branch. However, i do not want any other branch to issue a merge request with devops branch. Is it possible?
...
0
votes
1
answer
104
views
revert multiple branch merged to develop
So I have a branch named BRANCH_A and there is another branch named BRANCH_B which these two branchs merged to develop branch. Now something went wrong in BRANCH_A, it's looks like regression for some ...
1
vote
1
answer
85
views
git merge master after reverting the merge
I have a branch which was created from master.
I did some work in the branch. Now I decided to pull request the branch into the master, but there has happened a conflict. I decided to tackle the ...
1
vote
1
answer
2k
views
How to deal with a bugfix in GitFlow (or other process) once a release is ready to ship and merged into develop & master
From https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow :
Once the release is ready to ship, it will get merged it into master
and develop, then the release branch will ...
0
votes
1
answer
46
views
git: how to be able to switch branches again
I had a lot of uncommitted changes, which is bad practice.
I have tried to slowly commit all my important changes.
I was trying to reorganize work across branches, so I did (starting from my master ...
2
votes
2
answers
3k
views
Don't allow branch to merge to another branch
I have branch, which I want to allow go get merged, from another branch. BUT I don't allow it to merge to another branch(e.g Dev, master).
Thanks for help
1
vote
1
answer
881
views
Merging in Git doesn't open the code editor (Sublime)
I'm trying to merge two branches in Git and my Sublime editor won't open up, even though I have set it up as my default text editor and it was working just fine until now. It shows this message:
Auto-...
0
votes
0
answers
36
views
Git merge strategy for feature branches
I made a branch for a feature to keep the master branch clean. After I have now finished this feature I want to select the relevant commits and bring them back on top of the master. But as there are ...
1
vote
1
answer
3k
views
Git Merging - what happens to 2 branches being merged at same time
I have an unclear understanding about merging on git, which I would like to understand correctly.
Let's say, I have a file F on master branch, which has already 100 LOC. I create a branch A from ...
0
votes
1
answer
58
views
Git merging 2 branches not affecting all modified files
I'm working on a project with a team member and we just met a weird problem that we don't how to investigate and solve.
Basically all the team works on branch A, and he created a branch B out of A ...
2
votes
1
answer
158
views
How merge (or rebase) two branches to develop in special situation
My current state of tree looks like:
Q-W-E (Br2)
/
----A-B-C-D-E-F-G-H (develop)
\
X-Y-Z (Br1)
Now, I need merge these two branches to develop (in ...
2
votes
2
answers
6k
views
How do I push a new branch without pulling
So I've worked on new features and I realized that it would be too complicated to commit locally to master branch. Thus, I created a new branch as follows:
$ git stash branch project_0.2 stash@{0}
...
3
votes
1
answer
2k
views
TortoiseGit Graph does not show expected branching
Problem: The graph from TortoiseGit show log does not show the branching as expected. The development branch change color half way! From the steps below, it looks like it changes color at step 4 (from ...
81
votes
6
answers
13k
views
How can I delete all git branches which have been "Squash and Merge" via GitHub?
Ever since GitHub introduced Squash and Merge, all the cool kids at my workplace are using it when merging pull requests. Is there a way to cleanup "Squash and Merge" branches?
The following command ...
0
votes
1
answer
34
views
Git - Can automatic merges disappear with changes?
Guys this question is more conceitual than technical, I guess.
I have the feeling that sometimes when all team members work on the same branch, after several automatic merges in that branch, Git will ...
2
votes
1
answer
59
views
Is it possible in git to view who merged a branch if it was without a new commit?
User A committed (1) in the "master" branch.
User B committed (2) and (3) based on (1) in the "feature" branch.
User A merged (3) into the master branch.
So now it looks like this:
hash3 - (origin/...
2
votes
1
answer
3k
views
Git merge- Already up-to-date: hard reset?
I'm using Git as the version control for a Django/ Python project for which I recently took over the development, having not used it much previously.
Recently, I created a new branch from the master ...
3
votes
4
answers
376
views
git - How to checkout all changed files between two commits
I have a branch A and a branch B. Branch B is three commits ahead of A.
I can use git diff to list the changed files between A and B.
But my question is: How can I checkout all those changed files ...
0
votes
2
answers
404
views
Git merge- will old problems be merged into master if I merge an old branch?
I am using Git as the version control for my development, and am relatively new to it.
Shortly after starting work on this project, I created a branch called updateCards to work on resolving a ...
0
votes
3
answers
80
views
Why branch reported as not merged despite on it is merged
I have branch and all changes at that branch are at master (HEAD). but git diff master...feature/5492_new_currency shows me that it is not. Where am I wrong?
$ git diff master...feature/...
3
votes
2
answers
6k
views
Git push local master to remote specific branch [duplicate]
I did changes in my local branch. Then I checkout to my master branch and merge it with my local branch. Now I want to push the changes in the master branch to specific branch at the remote. Say, we ...
2
votes
2
answers
2k
views
How to remove a "branch" in repository after a git rebase on my local machine
I would like to delete a branch on my local repository. The problem is that it doesn't appear to be one.
I tried to merge from my branch called "Website" to master and i made a mistake by doing.
...
5
votes
1
answer
871
views
Find first branch on which a git commit was made
How can I find the first branch on which a commit was made? Seems able to do this but I'm not sure how.
It seems like this is not possible in git due to its design which places commits not branches ...
1
vote
2
answers
180
views
How can I merge 2 git repositories?
I have two git repositories, say project1 and project2, and project2 is located in a subfolder of project1 :
/project1/.git (with contents of project2/ ignored)
/project1/project2/.git
I would like ...
0
votes
0
answers
132
views
How to merge branches, omiting files' "delete mode"
I have two branches.
In a branch one I have dozens of files in "delete mode" and I want to merge it with a branch two, which has these files normally. (not all of them)
I want to merge the branch ...