Can you download explicitly Git changes?












0















I've been doing a bit of research, and discovered that you cannot download only the changed files. You can only download the whole commit. I think it's referred to as hash? Correct me please, if I am wrong. I would like to get a hold of the changed files between each commit only, is there a way to do it?



The reason this link doesn't work for me: Download only changed files git -- is because it's talking about merges. I need the changed files to analyse them, not to merge with my rep.










share|improve this question























  • You can compare them online, github shows the diff

    – Marged
    Nov 22 '18 at 16:01











  • Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

    – Daniil Gannota
    Nov 22 '18 at 16:04











  • How does the analysis look like ?

    – Marged
    Nov 22 '18 at 16:05











  • I use PMD to find new 'bugs', in the nutshell

    – Daniil Gannota
    Nov 22 '18 at 16:09






  • 1





    as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

    – terminally-chill
    Nov 22 '18 at 16:10
















0















I've been doing a bit of research, and discovered that you cannot download only the changed files. You can only download the whole commit. I think it's referred to as hash? Correct me please, if I am wrong. I would like to get a hold of the changed files between each commit only, is there a way to do it?



The reason this link doesn't work for me: Download only changed files git -- is because it's talking about merges. I need the changed files to analyse them, not to merge with my rep.










share|improve this question























  • You can compare them online, github shows the diff

    – Marged
    Nov 22 '18 at 16:01











  • Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

    – Daniil Gannota
    Nov 22 '18 at 16:04











  • How does the analysis look like ?

    – Marged
    Nov 22 '18 at 16:05











  • I use PMD to find new 'bugs', in the nutshell

    – Daniil Gannota
    Nov 22 '18 at 16:09






  • 1





    as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

    – terminally-chill
    Nov 22 '18 at 16:10














0












0








0








I've been doing a bit of research, and discovered that you cannot download only the changed files. You can only download the whole commit. I think it's referred to as hash? Correct me please, if I am wrong. I would like to get a hold of the changed files between each commit only, is there a way to do it?



The reason this link doesn't work for me: Download only changed files git -- is because it's talking about merges. I need the changed files to analyse them, not to merge with my rep.










share|improve this question














I've been doing a bit of research, and discovered that you cannot download only the changed files. You can only download the whole commit. I think it's referred to as hash? Correct me please, if I am wrong. I would like to get a hold of the changed files between each commit only, is there a way to do it?



The reason this link doesn't work for me: Download only changed files git -- is because it's talking about merges. I need the changed files to analyse them, not to merge with my rep.







git github






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 15:59









Daniil GannotaDaniil Gannota

235




235













  • You can compare them online, github shows the diff

    – Marged
    Nov 22 '18 at 16:01











  • Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

    – Daniil Gannota
    Nov 22 '18 at 16:04











  • How does the analysis look like ?

    – Marged
    Nov 22 '18 at 16:05











  • I use PMD to find new 'bugs', in the nutshell

    – Daniil Gannota
    Nov 22 '18 at 16:09






  • 1





    as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

    – terminally-chill
    Nov 22 '18 at 16:10



















  • You can compare them online, github shows the diff

    – Marged
    Nov 22 '18 at 16:01











  • Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

    – Daniil Gannota
    Nov 22 '18 at 16:04











  • How does the analysis look like ?

    – Marged
    Nov 22 '18 at 16:05











  • I use PMD to find new 'bugs', in the nutshell

    – Daniil Gannota
    Nov 22 '18 at 16:09






  • 1





    as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

    – terminally-chill
    Nov 22 '18 at 16:10

















You can compare them online, github shows the diff

– Marged
Nov 22 '18 at 16:01





You can compare them online, github shows the diff

– Marged
Nov 22 '18 at 16:01













Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

– Daniil Gannota
Nov 22 '18 at 16:04





Yh, but can I download that? I need to analyse the changed files. I am actually writing a script to analyse many changes at once, so I need something computable, not viewable.

– Daniil Gannota
Nov 22 '18 at 16:04













How does the analysis look like ?

– Marged
Nov 22 '18 at 16:05





How does the analysis look like ?

– Marged
Nov 22 '18 at 16:05













I use PMD to find new 'bugs', in the nutshell

– Daniil Gannota
Nov 22 '18 at 16:09





I use PMD to find new 'bugs', in the nutshell

– Daniil Gannota
Nov 22 '18 at 16:09




1




1





as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

– terminally-chill
Nov 22 '18 at 16:10





as @Marged mentioned, "diff" should work to list the files that have changed between two commits. Then you can download those files using "archive" to download the file from the repo at a specific commit

– terminally-chill
Nov 22 '18 at 16:10












1 Answer
1






active

oldest

votes


















1














Git holds only[1] the full version of files. When you use git diff (or any other command that shows a diff) the file differences are generated on the fly (this is how so many different formats are supported).



A commit that, for example, changes a single file is a link to a listing of the files that make up the working tree, one of these will will be a new version of the file, the rest the same as the previous commit.



See https://git-scm.com/book/en/v1/Git-Internals for far more details.



[1] There are some optimisations with pack files, but that is mostly an implementation detail.






share|improve this answer
























  • The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

    – Daniil Gannota
    Nov 22 '18 at 16:30













  • Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

    – Daniil Gannota
    Nov 22 '18 at 16:32













  • I get "fatal: bad object" when I try to git diff <commit1> <commit2>

    – Daniil Gannota
    Nov 22 '18 at 16:42











  • Found the issue, nvm! Haven't updated my rep properly! Many thx!

    – Daniil Gannota
    Nov 22 '18 at 16:44











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',
autoActivateHeartbeat: false,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434602%2fcan-you-download-explicitly-git-changes%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









1














Git holds only[1] the full version of files. When you use git diff (or any other command that shows a diff) the file differences are generated on the fly (this is how so many different formats are supported).



A commit that, for example, changes a single file is a link to a listing of the files that make up the working tree, one of these will will be a new version of the file, the rest the same as the previous commit.



See https://git-scm.com/book/en/v1/Git-Internals for far more details.



[1] There are some optimisations with pack files, but that is mostly an implementation detail.






share|improve this answer
























  • The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

    – Daniil Gannota
    Nov 22 '18 at 16:30













  • Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

    – Daniil Gannota
    Nov 22 '18 at 16:32













  • I get "fatal: bad object" when I try to git diff <commit1> <commit2>

    – Daniil Gannota
    Nov 22 '18 at 16:42











  • Found the issue, nvm! Haven't updated my rep properly! Many thx!

    – Daniil Gannota
    Nov 22 '18 at 16:44
















1














Git holds only[1] the full version of files. When you use git diff (or any other command that shows a diff) the file differences are generated on the fly (this is how so many different formats are supported).



A commit that, for example, changes a single file is a link to a listing of the files that make up the working tree, one of these will will be a new version of the file, the rest the same as the previous commit.



See https://git-scm.com/book/en/v1/Git-Internals for far more details.



[1] There are some optimisations with pack files, but that is mostly an implementation detail.






share|improve this answer
























  • The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

    – Daniil Gannota
    Nov 22 '18 at 16:30













  • Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

    – Daniil Gannota
    Nov 22 '18 at 16:32













  • I get "fatal: bad object" when I try to git diff <commit1> <commit2>

    – Daniil Gannota
    Nov 22 '18 at 16:42











  • Found the issue, nvm! Haven't updated my rep properly! Many thx!

    – Daniil Gannota
    Nov 22 '18 at 16:44














1












1








1







Git holds only[1] the full version of files. When you use git diff (or any other command that shows a diff) the file differences are generated on the fly (this is how so many different formats are supported).



A commit that, for example, changes a single file is a link to a listing of the files that make up the working tree, one of these will will be a new version of the file, the rest the same as the previous commit.



See https://git-scm.com/book/en/v1/Git-Internals for far more details.



[1] There are some optimisations with pack files, but that is mostly an implementation detail.






share|improve this answer













Git holds only[1] the full version of files. When you use git diff (or any other command that shows a diff) the file differences are generated on the fly (this is how so many different formats are supported).



A commit that, for example, changes a single file is a link to a listing of the files that make up the working tree, one of these will will be a new version of the file, the rest the same as the previous commit.



See https://git-scm.com/book/en/v1/Git-Internals for far more details.



[1] There are some optimisations with pack files, but that is mostly an implementation detail.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 16:14









RichardRichard

88.8k17150219




88.8k17150219













  • The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

    – Daniil Gannota
    Nov 22 '18 at 16:30













  • Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

    – Daniil Gannota
    Nov 22 '18 at 16:32













  • I get "fatal: bad object" when I try to git diff <commit1> <commit2>

    – Daniil Gannota
    Nov 22 '18 at 16:42











  • Found the issue, nvm! Haven't updated my rep properly! Many thx!

    – Daniil Gannota
    Nov 22 '18 at 16:44



















  • The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

    – Daniil Gannota
    Nov 22 '18 at 16:30













  • Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

    – Daniil Gannota
    Nov 22 '18 at 16:32













  • I get "fatal: bad object" when I try to git diff <commit1> <commit2>

    – Daniil Gannota
    Nov 22 '18 at 16:42











  • Found the issue, nvm! Haven't updated my rep properly! Many thx!

    – Daniil Gannota
    Nov 22 '18 at 16:44

















The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

– Daniil Gannota
Nov 22 '18 at 16:30







The file differences. What about the difference of all files between two commits? Like, one commit is different from the next because the next has two files changed. git diff seems to work only with individual files.

– Daniil Gannota
Nov 22 '18 at 16:30















Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

– Daniil Gannota
Nov 22 '18 at 16:32







Forgive me if I'm wrong, I am trying to figure it out. What would be the command to use to compare two commits from the same branch?

– Daniil Gannota
Nov 22 '18 at 16:32















I get "fatal: bad object" when I try to git diff <commit1> <commit2>

– Daniil Gannota
Nov 22 '18 at 16:42





I get "fatal: bad object" when I try to git diff <commit1> <commit2>

– Daniil Gannota
Nov 22 '18 at 16:42













Found the issue, nvm! Haven't updated my rep properly! Many thx!

– Daniil Gannota
Nov 22 '18 at 16:44





Found the issue, nvm! Haven't updated my rep properly! Many thx!

– Daniil Gannota
Nov 22 '18 at 16:44


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434602%2fcan-you-download-explicitly-git-changes%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Feedback on college project

Futebolista

Albești (Vaslui)