How are git parent numbers assigned? -


from documentation git-rev-parse:

^, e.g. head^, v1.5.1^0

a suffix ^ revision parameter means first parent of commit object. ^<n> means <n>th parent (i.e. <rev>^ equivalent <rev>^1). special rule, <rev>^0 means commit , used when <rev> object name of tag object refers commit object. 

i understand git commits can have multiple parents, , syntax can used disambiguate parent referred to, determines parent 'first parent' or 'second parent'? based on commit checked out when commits merged?

for example, git checkout master; git merge feature result in master being parent 1, whereas git checkout feature; git merge master result in feature being parent 1? or there else going on here?

is based on commit checked out when commits merged?

that's right. can @ parents of commit using git show or git cat-file -p head.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -