git-merge

How to pull a single file from a server repository in Git?

久未见 提交于 2019-12-20 08:00:13
问题 I am working on a site with a server running Git. I am using Git for deployment (not GitHub). This was set up prior to my involvement using a hook method, and I referred to this question and entered the commands below, but it didn't work. How do I pull a single file from the server? For instance, if I wanted to update my local file index.php? git pull index.php ? 回答1: It is possible to do (in the deployed repository): git fetch // git fetch will download all the recent changes, but it will

git merge squash - conflict resolution when all I want is the changes from the branch I squashed from

邮差的信 提交于 2019-12-20 03:37:08
问题 I have github branch which I push to github when the master branch reaches some acceptable state (have done this once). To this end I did : MrD@MRSD /c/Dropbox/eclipse_workspaces/android/AndroidMonitoring (master) $ git checkout github Switched to branch 'github' MrD@MRSD /c/Dropbox/eclipse_workspaces/android/AndroidMonitoring (github) $ git merge --squash master Auto-merging src/gr/uoa/di/monitoring/android/services/Monitor.java CONFLICT (add/add): Merge conflict in src/gr/uoa/di/monitoring

How does --no-ff merge break bisect and blame?

╄→гoц情女王★ 提交于 2019-12-20 01:01:43
问题 Understanding the Git Workflow article says, So you add a new rule: “When you merge in your feature branch, use –no-ff to force a new commit.” This gets the job done, and you move on. Then one day you discover a critical bug in production, and you need to track down when it was introduced. You run bisect but keep landing on checkpoint commits. You give up and investigate by hand. You narrow the bug to a single file. You run blame to see how it changed in the last 48 hours. You know it’s

.gitattributes: merge=ours strategy vs. fast-forward merging

回眸只為那壹抹淺笑 提交于 2019-12-19 10:31:12
问题 If I am in such a git situation: * da6a750 (A) Further in A, okay for merging back into master * bf27b58 Merge branch 'master' into A |\ | * 86294d1 (HEAD -> master) Development on master * | abe6b8a Welcome to branch A |/ * 589517c First commit On the master branch, three files: ./development : development on master initial ./specific : master branch ./.gitattributes : specific merge=ours On A branch, three files as well: ./development : development on master initial development in A further

git: finding which merge brough commit into the current branch

人盡茶涼 提交于 2019-12-19 10:11:23
问题 I have a number of branches, which are periodically merged, i.e. we can have A, which is merged into B, then B into C, then A into D and D into C, etc. Suppose I have a commit X, which I know was originally introduces in A, and then merged into C somehow (I can see it when I do git log C). Is there a way to find out which merge (which merge commit) brought the commit X into the branch C? 回答1: Usually I do something like the following: git log --oneline --ancestry-path --merges <commit-of

Git: 'Master cannot be resolved to branch' after merge

走远了吗. 提交于 2019-12-19 06:46:36
问题 Every time I merge a branch back into my master branch, I can no longer push to origin. I get the message fatal: master cannot be resolved to branch I made a simple test change: Created a new branch git branch TestBranch Made a change to TestBranch and commited Checked out back to master git checkout Master Merged TestBranch git merge TestBranch The merge seems to have gone fine, but now when I use Git status the Master branch does not tell me that it is ahead of the origin. And when I try to

git: what is the correct merging or rebasing workflow to modify a maintenance branch and apply those patches to another branch?

孤人 提交于 2019-12-18 13:26:37
问题 Objective : I need to make custom patches to a prior release of an upstream project, and I want to be able to apply those patches to the later version. Problem : Rebasing from the maintenance branch to a later version creates conflicts with files that have not been modified in the maintenance branch. Suspicion : I am applying merging or rebasing incorrectly for what I'm trying to accomplish. Example: This is a logical example of what I want to accomplish, but understand that the commit

Using git to merge two directories with common parent (but different SHA1)

若如初见. 提交于 2019-12-18 12:01:23
问题 In our project somebody took a copy of the code. They started a new git repository in their directory and continued their work there. Meanwhile the work on our main project repository also continued. We are now left with two git repositories with no common SHA1. A --- B --- C --- D | | Copy of code to new directory | E --- F --- G B and E are the exact same files, folders, etc. Our goal is to use Git to merge changes F and G into the main branch (currently at D) 回答1: First, I'm going to

Replaced third party code with git submodules, now I can't switch branches

对着背影说爱祢 提交于 2019-12-18 11:09:06
问题 Here's the story: I have 2 git branches master and develop I'm currently on develop . I've long since had the source files of a third party library included in my repo in the directory Vendor/MGTwitterEngine . This code was already merged into master. Now, on branch develop , I've removed the library and replaced it with a git submodule and committed. The problem is I can no longer switch back to the master branch. If I try, I get the following error: The following untracked working tree

Why does the same conflict reappear when I use git rebase?

孤者浪人 提交于 2019-12-18 10:39:07
问题 I have read relevant questions about git merge and git rebase on SO, but I still cannot fully understand what is happening under the hood. Here is our branching situation: MASTER------------------------ \ \ \ \----Feature B--- \ \ \-----Feature A----------\---Feature A+B We have 2 feature branches that stem from master at different time, now we want to combine the 2 branches. We want to follow the first rebase then merge practice, but when we rebase Feature A to Feature B, we get conflicts.