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?
git
add a comment |
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?
git
But I can't find log... I would say that in general if you can't see the commits in your branch viagit 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 rangit resetto 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
add a comment |
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?
git
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
git
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 viagit 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 rangit resetto 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
add a comment |
But I can't find log... I would say that in general if you can't see the commits in your branch viagit 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 rangit resetto 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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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
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
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
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
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
But I can't find log... I would say that in general if you can't see the commits in your branch viagit 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 resetto 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