Merging branch - merge too large to display but only one file has been changed? - merge

I have created a branch feature/cms-wysiwyg-fix from master branch. FYI we have a branch for each of our environments so master, test and dev.
So in feature/cms-wysiwyg-fix branch I have committed and pushed one file - storage.php
When I try to merge feature/cms-wysiwyg-fix into dev branch it is saying merge too large to display.
However if I go to merge feature/cms-wysiwyg-fix into test or master branch it displays the modified file storage.php as the only difference.
If I go to merge dev branch into test or master there is no difference?
So I am not sure why the merge is too large too display when I try to merge feature/cms-wysiwyg-fix branch into dev branch ?

Related

Azure Devops Merge only specific commit

Azure Devops
Scenario : I have branch dev and master. There is commit in dev branch AS Commit1, Commit2, Commit 3 and Commit4 and all this changes release on dev site. Now I have approval for Commit1 and Commit3 to release on production. So how can I merge only commit1 and commit3 from dev branch to master branch
Important Note: I'm sure you know this but I think it's worth mentioning that you haven't actually tested exactly what you intend to release. You may benefit from having another branch, say release, where you put the stuff you decide to release, and then you can periodically reset dev to master to clean it up. (And if you do this I would consider calling dev something like next like gitworkflows, which is a similar concept.)
Solution 1 (Most General):
Create a new branch from master, cherry-pick the commits you want from dev, and merge this "release" branch into master.
Solution 2 (Works if your dev branch has merge commits for each commit brought into dev, and those commits' parent is master.):
Create a new branch from master, merge in each of the branches for the commits, and merge this "release" branch into master.
Solution 3 (Works if your dev history is linear after master, and if you never intend to bring in commit 2):
Disclaimer: this is more of an academic answer and I likely wouldn't actually use this solution in your scenario...
Create a new branch from master, and then perform 3 merges:
git switch -c release master
git merge Commit1 # take commit1
git merge -s ours Commit2 # merge commit2 but ignore it's changes!
git merge Commit3 # take commit3
# merge release branch into master
git switch master
git merge release

why is my master branch merging into another branch

this is my first day learning github and i tried to merge a branch to my master branch
so here's what's in my master branch (it's just a text file)
# test-repo2
-html
-css
-js
-angular
-django
and here's what's in my another branch
# test-repo2
-html
-css
-js
-react
-react hooks
-deno
so basically i want to replace the "django" and "angular" in master branch with "react" "react hooks" and "deno" from another branch in other words i want to make the commit in master looks completely the same as the commit in another branch but i want to do it by merging the other branch to the master not the other way around not like this
You should be able to merge your master branch into other branches as well as other branches into master.
You should choose the correct option while doing the merge. You should choose your other branch as source branch and master as target.

What is the best way to use the option 'Merge [branch name] into current branch' - SourceTree

I want to know what is the best way to use the command: Merge branch name into current branch
What i am doing (Let us suppose I want to merge master into develop):
I checkout to the master branch and pull all the recent changes.
Then I go back to the develop branch.
I right click on the master branch and click Merge branch name into current branch.
And the master branch will merge into the develop branch.
Is this correct?
Your methodology looks correct.
If you are not seeing any changes tothe branch you are merging into - then it is likely this branch is already up-to-date with the branch merged into it.
You can also look up the following references on the Merge comnmand you are using:
Git Tutorial (Beginner): Using GitLab & Source Tree

VSTS: Difference between default and compare branch

In my git repository I have three branches: master: default, dev: compare, and temp.
When I create a Pull Request from temp branch it defaults to dev as the target.
It is in contradiction with what Microsoft documentation says:
Change the default branch used to merge code into when your team
creates new pull requests. This is useful when you want to use a
branch other than master for the main line of development in your
repo.
Am I missing something?
For default branch, it helps you to treat the branch as default when cloning the git repo locally or creating a PR.
Such as if you treat master branch as default branch (by default), when you cloned the git repo locally, the local branch is master. And when you creating a PR, it will automatically treat master branch as the target branch.
For compare branch, it helps you to decide how many commits on the other branches are behind or ahead by comparing commits on other branches with the compare branch.
Such as for above example, develop branch is compare branch, and master branch and nn1 branch are compare with develop branch.
For comparing master branch with develop branch, there has 0 commits behind and 0 commit ahead (master branch same as develop branch). For comparing nn1 branch with develop branch, there are 3 commits behind and 48 commits ahead.
I did some quick tests in my VSTS tenant. It looks like the default branch of a new pull request is always the Compare branch, rather than the Default branch. So if you set your master branch as Compare branch, it should become to the default for new pull requests.
Not sure if it is bug of VSTS, or if they change the behavior of pull request without updating the doc.
Update:
I did some further research. It turned out that this change was introduced in a Oct 2016 feature roll out:
You can now set your compare branch to something other than the
default branch. This setting will be remembered on a per-user basis.
Pull requests and new branches created from the Branches page will be
based off the branch you set as the compare branch.
So the doc needs to be updated.

Branch issue when using EGit Eclipse

I have master branch of the project. Then I want to add a new feature so I create a new branch called "new_feature", base on master branch. In new_feature branch, everything works fine and I want to delete some files that are no longer useful. But when I switch back to master branch and merge with new_feature branch, these deleted files still exist.
Here is my question: what I have to do to make master branch is exactly the same as the new_feature branch so I can delete new_feature branch.
Thanks in advance!
You need merge new_feature branch to master.
The steps are,
Switch to master branch
Team - Merge, select new_feature branch
Sounds like you forgot to check in the delete. In Eclipse, switch to the feature branch and open the Git Staging view to see changes that are still pending. File deletes get staged automatically, but not committed.
Required sequence is
Delete - commit - push - checkout other branch - merge - commit - push
#Duc Le: You must merge your new_feature branch to your master branch to get all modified file in new_feature branch into master branch.
Maybe something like this you can follow :
Check your branch :
$ git branch
new_feature * (your active branch)
master
Switch to your master branch :
$ git checkout master
Merge your new_feature to master branch without fast-forward mode:
$ git merge --no-ff new_feature
Explanation about merging without fast-forward