How can I view file history in Git?

Use git log to view the commit history. Each commit has an associated revision specifier that is a hash key (e.g. 14b8d0982044b0c49f7a855e396206ee65c0e787 and b410ad4619d296f9d37f0db3d0ff5b9066838b39). To view the difference between two different commits, use git diff with the first few characters of the revision specifiers of both commits, like so: # diff between commits 14b8… and … Read more

Does deleting a branch in git remove it from the history?

Branches are just pointers to commits in git. In git each commit has a complete source tree, it is a very different structure from svn where all branches and tags (by convention) live in separate ‘folders’ of the repository alongside the special ‘trunk’. If the branch was merged into another branch before it was deleted … Read more

Go to particular revision

Before executing this command keep in mind that it will leave you in detached head status Use git checkout <sha1> to check out a particular commit. Where <sha1> is the commit unique number that you can obtain with git log Here are some options after you are in detached head status: Copy the files or … Read more

tech