Git merge and diff
up vote
1
down vote
favorite
I have a question about the use of git.
Actually I have two branch in my repository (feature-2, feature-certification). Now I've received a source code from another user and I need to compare his files with my branch (feature-certification). Those files are not under git or remote branch, it's just a folder with files.
What I tried:
I created a new branch and added all the files that I've received then I pushed to the new branch but when I tried to merge into feature-certification I noticed that ALL files are treated like new even when they're not new
Is there any way to check the diff between my branch and the files of the other folder that I have?
git merge bitbucket branch
add a comment |
up vote
1
down vote
favorite
I have a question about the use of git.
Actually I have two branch in my repository (feature-2, feature-certification). Now I've received a source code from another user and I need to compare his files with my branch (feature-certification). Those files are not under git or remote branch, it's just a folder with files.
What I tried:
I created a new branch and added all the files that I've received then I pushed to the new branch but when I tried to merge into feature-certification I noticed that ALL files are treated like new even when they're not new
Is there any way to check the diff between my branch and the files of the other folder that I have?
git merge bitbucket branch
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a question about the use of git.
Actually I have two branch in my repository (feature-2, feature-certification). Now I've received a source code from another user and I need to compare his files with my branch (feature-certification). Those files are not under git or remote branch, it's just a folder with files.
What I tried:
I created a new branch and added all the files that I've received then I pushed to the new branch but when I tried to merge into feature-certification I noticed that ALL files are treated like new even when they're not new
Is there any way to check the diff between my branch and the files of the other folder that I have?
git merge bitbucket branch
I have a question about the use of git.
Actually I have two branch in my repository (feature-2, feature-certification). Now I've received a source code from another user and I need to compare his files with my branch (feature-certification). Those files are not under git or remote branch, it's just a folder with files.
What I tried:
I created a new branch and added all the files that I've received then I pushed to the new branch but when I tried to merge into feature-certification I noticed that ALL files are treated like new even when they're not new
Is there any way to check the diff between my branch and the files of the other folder that I have?
git merge bitbucket branch
git merge bitbucket branch
asked Nov 22 at 3:06
Dex Sebas
107210
107210
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41
add a comment |
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
In my working directory just copy and paste the new files?
Yes, as long as your working directory is clean, meaning all your current files are added and committed.
Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.
At any point, you can get back to your original state with git reset --hard
.
A less intrusive option would be:
cd /path/to/my/repo
git --work-tree=/path/to/receives/files/folder diff
That would show you the difference between the common files and your current index.
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423297%2fgit-merge-and-diff%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
In my working directory just copy and paste the new files?
Yes, as long as your working directory is clean, meaning all your current files are added and committed.
Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.
At any point, you can get back to your original state with git reset --hard
.
A less intrusive option would be:
cd /path/to/my/repo
git --work-tree=/path/to/receives/files/folder diff
That would show you the difference between the common files and your current index.
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
add a comment |
up vote
2
down vote
accepted
In my working directory just copy and paste the new files?
Yes, as long as your working directory is clean, meaning all your current files are added and committed.
Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.
At any point, you can get back to your original state with git reset --hard
.
A less intrusive option would be:
cd /path/to/my/repo
git --work-tree=/path/to/receives/files/folder diff
That would show you the difference between the common files and your current index.
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
In my working directory just copy and paste the new files?
Yes, as long as your working directory is clean, meaning all your current files are added and committed.
Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.
At any point, you can get back to your original state with git reset --hard
.
A less intrusive option would be:
cd /path/to/my/repo
git --work-tree=/path/to/receives/files/folder diff
That would show you the difference between the common files and your current index.
In my working directory just copy and paste the new files?
Yes, as long as your working directory is clean, meaning all your current files are added and committed.
Then you can copy/overwrite your files with the new ones: a git status/git diff will show you the differences.
At any point, you can get back to your original state with git reset --hard
.
A less intrusive option would be:
cd /path/to/my/repo
git --work-tree=/path/to/receives/files/folder diff
That would show you the difference between the common files and your current index.
edited Nov 22 at 5:36
answered Nov 22 at 5:34
VonC
826k28525993139
826k28525993139
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
add a comment |
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
Thank you ! I made that way and it works
– Dex Sebas
Nov 22 at 5:36
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423297%2fgit-merge-and-diff%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you put them in the same folder? Or different folders?
– evolutionxbox
Nov 22 at 3:38
Actually I have my working repo in one directory and the source code that I've received in other folder
– Dex Sebas
Nov 22 at 3:38
That’s why then. As you’ve added new files, not updated any.
– evolutionxbox
Nov 22 at 3:40
How should I proceed? In my working directory just copy and paste the new files? (This would replace some files)
– Dex Sebas
Nov 22 at 3:41