{"thread":{"id":"45354","subject":"How to view diff when doing `git push --force`","startedAt":"2017-03-11T14:52:36Z","lastAt":"2018-01-10T13:57:45Z","messageCount":3,"participants":["KES","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"313828","messageId":"6962041489243945@web20g.yandex.ru","threadId":"45354","inReplyTo":null,"subject":"How to view diff when doing `git push --force`","fromName":"KES","fromEmail":"kes-kes@yandex.ru","sentAt":"2017-03-11T14:52:25Z","receivedAt":"2017-03-11T14:52:36Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"Hi. I have done `git push --force` but I forget to `pull`, \n\n\nCounting objects: 7, done.\nDelta compression using up to 4 threads.\nCompressing objects: 100% (7/7), done.\nWriting objects: 100% (7/7), 765 bytes | 0 bytes/s, done.\nTotal 7 (delta 6), reused 0 (delta 0)\nTo xxxgit:cry/cry.git\n + 48e9058...117ee39 staging -> staging (forced update)\n\nBut I can not view diff:\n\ngit show 48e9058...117ee39\nfatal: ambiguous argument '48e9058...117ee39': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n\n\nMay I pull info about changes that was deleted?\n"},{"id":"313830","messageId":"CACBZZX5g95nTtA5--g8K29FjQ=dU3JLEfVXZjUs8J2Y-QCzYHg@mail.gmail.com","threadId":"45354","inReplyTo":"6962041489243945@web20g.yandex.ru","subject":"Re: How to view diff when doing `git push --force`","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2017-03-11T19:30:00Z","receivedAt":"2017-03-11T19:30:26Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Mar 11, 2017 at 3:52 PM, KES <kes-kes@yandex.ru> wrote:\n> Hi. I have done `git push --force` but I forget to `pull`,\n>\n> Counting objects: 7, done.\n> Delta compression using up to 4 threads.\n> Compressing objects: 100% (7/7), done.\n> Writing objects: 100% (7/7), 765 bytes | 0 bytes/s, done.\n> Total 7 (delta 6), reused 0 (delta 0)\n> To xxxgit:cry/cry.git\n>  + 48e9058...117ee39 staging -> staging (forced update)\n>\n> But I can not view diff:\n>\n> git show 48e9058...117ee39\n> fatal: ambiguous argument '48e9058...117ee39': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions, like this:\n> 'git <command> [<revision>...] -- [<file>...]'\n>\n> May I pull info about changes that was deleted?\n\nAt this point, no, but in the future instead of --force use\n--force-with-lease=<refname>:<expect> where <expect> is e.g. $(git\nrev-parse HEAD).\n"},{"id":"336379","messageId":"40271515592088@web42o.yandex.ru","threadId":"45354","inReplyTo":"CACBZZX5g95nTtA5--g8K29FjQ=dU3JLEfVXZjUs8J2Y-QCzYHg@mail.gmail.com","subject":"Re: How to view diff when doing `git push --force`","fromName":"KES","fromEmail":"kes-kes@yandex.ru","sentAt":"2018-01-10T13:48:08Z","receivedAt":"2018-01-10T13:57:45Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"> At this point, no, but in the future instead of --force use\n> --force-with-lease=<refname>:<expect> where <expect> is e.g. $(git\n> rev-parse HEAD).\n\nThank you.\n\nBut I have found next command to see what were changed. \nFor example if someone did forced push and I wanna see changes before merge remote\n\ngit log --graph --decorate --pretty=oneline --abbrev-commit --cherry-mark --boundary --left-right\n\nBut is there an option to view changes in amended commits?\n\nSee the last code post about unknown option  in the next answer :\nhttps://stackoverflow.com/a/48149931/4632019\n\n\nIf there is no such option. Will it be useful to have it?\n"}]}