mmt zyx mmt zyx - 1 year ago 79
Git Question

What branch am I on now?

I'm using

. When I run
git status
, it shows the output below. My question is, what branch am I on?

d:\2016_Project\toyota\tpm>git status
HEAD detached from 42376c1
nothing to commit, working directory clean

d:\2016_Project\toyota\tpm>git log --all --oneline
5d4239f done basic styling
42376c1 done notif on reminder page
d673796 done reminder page
514aba8 done prospek task
e88ff91 done update prospek profil & task
289654b add fontawesome
377c594 done basic prospek profile
d59022c add prospek task

Here is when I list my branch. Which branch that have my last changed version?

d:\2016_Project\toyota\tpm>git branch
* (detached from 42376c1)

Answer Source

You're not currently on a branch. Your git is currently in what is known as "detached HEAD" mode, in which your HEAD (the current most recent commit) is pointing to an arbitrary commit in your history rather than the tip of a specific branch. You most likely reached this state by doing git checkout <commit-id>, and can return to the tip of a branch of your choosing by doing git checkout <branch-name>.