On Sat, May 09, 2020 at 04:18:02PM +0530, Kunal Chauhan wrote:

> Q1 .I have a several committ at my branch but I want to go to particular
> commit and check out that code.

  git checkout <sha1_of_that_commit>

The SHA-1 name of the commit to check out can be found out via `git log`
or any other tool which allows to browse the history.

Note that once you check out a commit directly - as opposed to checking
out a branch by its name - the work tree switches into the so-called
"detached HEAD" state: that is, recording new commits won't place them
on any branch (since no branch has been checked out, to begin with).
This situation is completely normal but is something to be aware of and
learn about [1, 2].

> Q2. Like some time we have to find a crash in my code file what is the best
> way to narrow the crash.

`git bisect` is the tool to search for "bad" commit given two "known
good" commits. Basically it automates binary searching through the graph
of commits - checking out sample commits and allowing the user to test
whether the commit is broken or not and mark it accordingly.

> And I have logs only for particular crash means last prints

It's possible that I failed to parse this statement correctly but I
can't see how it can be connected to Git. Debugging printouts of a
running program have nothing to with the version control system used to
manage its source code.


Please take no offence but Q1 suggests you did not yet took an
inroductory course on Git. If yes, it's a sure path to failure: the
mailing list we're carrying out this discussion on is not for reciting
Git manuals, - rather, it's for helping users solve genuine problems not
covered by HOWTOs and books.

So please take your time and educate yourself the basics of Git.
Let me assure you it'll save your neck (and our precious time) later.

1. https://git-scm.com/docs/git-checkout#_detached_head
2. https://git-scm.com/book/en/v2/Git-Internals-Git-References#ref_the_ref

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20200509114419.wmmt5a4dp3sy536z%40carbon.

Reply via email to