Can I checkout to most current commit on git?











up vote
0
down vote

favorite












I have a git alias lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all



when I run $ git lg and I can see below.



*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/
* 3c98495 - (5weeks ago) Delete old depart info and blog section - me (HEAD -> master)
* ffa196a - (5weeks ago) Delete client list section - me
* 4934070 - (5weeks ago) Delete portfolio section - me
* f73d676 - (5weeks ago) Show custom categories about departments - me
| * a9a174a - (5weeks ago) tmp save - me (feature/tmp)
|/
* 1f420bc - (7weeks ago) blabla... - me (origin/master, origin/HEAD)
.
.
.


But I had a more commit logs after 0c86f9e. maybe like below



*   0111113 - (3days ago) blahblah - me (HEAD)
* 0111111 - (3days ago) blahblah - me
* 0222222 - (3days ago) blahblah - me
* 0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/


I want to go most current commit. But I can't find log. How can I see log and jump?










share|improve this question






















  • But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
    – Tim Biegeleisen
    3 hours ago










  • Then I can't go to most current commit...?
    – errorMessage
    3 hours ago










  • If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
    – torek
    33 mins ago















up vote
0
down vote

favorite












I have a git alias lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all



when I run $ git lg and I can see below.



*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/
* 3c98495 - (5weeks ago) Delete old depart info and blog section - me (HEAD -> master)
* ffa196a - (5weeks ago) Delete client list section - me
* 4934070 - (5weeks ago) Delete portfolio section - me
* f73d676 - (5weeks ago) Show custom categories about departments - me
| * a9a174a - (5weeks ago) tmp save - me (feature/tmp)
|/
* 1f420bc - (7weeks ago) blabla... - me (origin/master, origin/HEAD)
.
.
.


But I had a more commit logs after 0c86f9e. maybe like below



*   0111113 - (3days ago) blahblah - me (HEAD)
* 0111111 - (3days ago) blahblah - me
* 0222222 - (3days ago) blahblah - me
* 0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/


I want to go most current commit. But I can't find log. How can I see log and jump?










share|improve this question






















  • But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
    – Tim Biegeleisen
    3 hours ago










  • Then I can't go to most current commit...?
    – errorMessage
    3 hours ago










  • If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
    – torek
    33 mins ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a git alias lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all



when I run $ git lg and I can see below.



*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/
* 3c98495 - (5weeks ago) Delete old depart info and blog section - me (HEAD -> master)
* ffa196a - (5weeks ago) Delete client list section - me
* 4934070 - (5weeks ago) Delete portfolio section - me
* f73d676 - (5weeks ago) Show custom categories about departments - me
| * a9a174a - (5weeks ago) tmp save - me (feature/tmp)
|/
* 1f420bc - (7weeks ago) blabla... - me (origin/master, origin/HEAD)
.
.
.


But I had a more commit logs after 0c86f9e. maybe like below



*   0111113 - (3days ago) blahblah - me (HEAD)
* 0111111 - (3days ago) blahblah - me
* 0222222 - (3days ago) blahblah - me
* 0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/


I want to go most current commit. But I can't find log. How can I see log and jump?










share|improve this question













I have a git alias lg = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all



when I run $ git lg and I can see below.



*   0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/
* 3c98495 - (5weeks ago) Delete old depart info and blog section - me (HEAD -> master)
* ffa196a - (5weeks ago) Delete client list section - me
* 4934070 - (5weeks ago) Delete portfolio section - me
* f73d676 - (5weeks ago) Show custom categories about departments - me
| * a9a174a - (5weeks ago) tmp save - me (feature/tmp)
|/
* 1f420bc - (7weeks ago) blabla... - me (origin/master, origin/HEAD)
.
.
.


But I had a more commit logs after 0c86f9e. maybe like below



*   0111113 - (3days ago) blahblah - me (HEAD)
* 0111111 - (3days ago) blahblah - me
* 0222222 - (3days ago) blahblah - me
* 0c86f9e - (3weeks ago) WIP on master: 3c98495 Delete old depart info and blog section - me(refs/stash)
|
| * 1790d55 - (3weeks ago) index on master: 3c98495 Delete old depart info and blog section - me
|/


I want to go most current commit. But I can't find log. How can I see log and jump?







git






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









errorMessage

71113




71113












  • But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
    – Tim Biegeleisen
    3 hours ago










  • Then I can't go to most current commit...?
    – errorMessage
    3 hours ago










  • If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
    – torek
    33 mins ago


















  • But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
    – Tim Biegeleisen
    3 hours ago










  • Then I can't go to most current commit...?
    – errorMessage
    3 hours ago










  • If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
    – torek
    33 mins ago
















But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
– Tim Biegeleisen
3 hours ago




But I can't find log ... I would say that in general if you can't see the commits in your branch via git log, then they aren't there.
– Tim Biegeleisen
3 hours ago












Then I can't go to most current commit...?
– errorMessage
3 hours ago




Then I can't go to most current commit...?
– errorMessage
3 hours ago












If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
– torek
33 mins ago




If you ran git reset to move your branch name, you've told your Git to throw out the newer commits. If you got them from some other Git, you can just get them from that other Git again. If not, use your reflogs to find the commits you told Git to throw away, and be glad that Git secretly keeps them (without showing them to you) for an extra month or more by default.
– torek
33 mins ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













Assuming the more recent commits you refer to are on the server, you need to pull.
Run git pull, or git fetch if you do not want to update your current local version.
The commits should then be visible.






share|improve this answer





















  • More recent commits aren't on the server.... Do you have any other solution?
    – errorMessage
    2 hours ago










  • Where are they then ?
    – Vince
    2 hours ago










  • They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
    – errorMessage
    2 hours ago













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
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203361%2fcan-i-checkout-to-most-current-commit-on-git%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Assuming the more recent commits you refer to are on the server, you need to pull.
Run git pull, or git fetch if you do not want to update your current local version.
The commits should then be visible.






share|improve this answer





















  • More recent commits aren't on the server.... Do you have any other solution?
    – errorMessage
    2 hours ago










  • Where are they then ?
    – Vince
    2 hours ago










  • They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
    – errorMessage
    2 hours ago

















up vote
0
down vote













Assuming the more recent commits you refer to are on the server, you need to pull.
Run git pull, or git fetch if you do not want to update your current local version.
The commits should then be visible.






share|improve this answer





















  • More recent commits aren't on the server.... Do you have any other solution?
    – errorMessage
    2 hours ago










  • Where are they then ?
    – Vince
    2 hours ago










  • They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
    – errorMessage
    2 hours ago















up vote
0
down vote










up vote
0
down vote









Assuming the more recent commits you refer to are on the server, you need to pull.
Run git pull, or git fetch if you do not want to update your current local version.
The commits should then be visible.






share|improve this answer












Assuming the more recent commits you refer to are on the server, you need to pull.
Run git pull, or git fetch if you do not want to update your current local version.
The commits should then be visible.







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 hours ago









Vince

358




358












  • More recent commits aren't on the server.... Do you have any other solution?
    – errorMessage
    2 hours ago










  • Where are they then ?
    – Vince
    2 hours ago










  • They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
    – errorMessage
    2 hours ago




















  • More recent commits aren't on the server.... Do you have any other solution?
    – errorMessage
    2 hours ago










  • Where are they then ?
    – Vince
    2 hours ago










  • They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
    – errorMessage
    2 hours ago


















More recent commits aren't on the server.... Do you have any other solution?
– errorMessage
2 hours ago




More recent commits aren't on the server.... Do you have any other solution?
– errorMessage
2 hours ago












Where are they then ?
– Vince
2 hours ago




Where are they then ?
– Vince
2 hours ago












They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
– errorMessage
2 hours ago






They were on the local. I thought that commits were on the local master branch but It wasn't. After I checkout to the old commit, I can't go back to the most recent commit.
– errorMessage
2 hours ago




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203361%2fcan-i-checkout-to-most-current-commit-on-git%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Landwehr

Reims

Javascript gets undefined on array