Tag: commit

How to see difference of first and third commit in git?

I have a problem , I need to see difference of first and third commit in git, but I can see diff of any commit and previous to it.

Can you undo 'git reset –hard HEAD' if never having made a commit?

I lost some code after running git reset –hard HEAD and I never committed the work. Is there any way to get this code back? Was it logged anywhere? Can I undo the command?

Do I need to commit in Git, when should I do this, and how can I revert to old versions?

I’ve been following a tutorial on Git and I’m a bit confused about a few specific issues. The main reason I need to use version control right now is simply to access previous versions of my project if I make a mistake and don’t know how to get rid of an error. Is it true […]

How to get (only) author name or email in git given SHA1?

I would like to check for author‘s e-mail and name, surname to verify who’s pushing to my repo. Is there any way that I can come up with a command in git to show commiter’s name/e-mail given only SHA1 of the commit? This is what I came up with but it’s far from ideal solution […]

how do I complete a git commit?

I typed in ‘git –commit‘ and got the following on my terminal # Please enter the commit message for your changes. Lines starting # with ‘#’ will be ignored, and an empty message aborts the commit. # On branch master # # Initial commit # # Changes to be committed: # new file: index.html # […]

why some git commits are older than their parent?

I was looking at apache-drill commit 3efc2eca and I realized that it is older than its parent commit 8614bae. I have had a couple of other similar observations. How can I explain them?

Does a commit in Git represent the state of a repository?

As I had understood it, when you do a commit in Git, a snapshot of the entire state of the repository is made and that allows me to go back to that state when its necessary. So, to me a commit represents not a change, but a state of a repository. When you want to […]

git commit – how can I see the changes that were made while doing a commit

Can I set git to show me the diffs while doing the interactive commit (i.e. no -m”msg”) This would let me see what the changes are I am committing.

reverse back to certain commit and test what the issue?

Is there a way to keep all my changes now, and still reverse back my app to a certain commit and start going through all other commits to see which one caused an issue in my app? I did a lot of changes, and it would take me a long time to check everything, so […]

git: How to get the latest commit on a specific file, regardless of branch?

I have this big repository containing different modules, which should have been broken down in different repositories, one for each module. Sometimes I created a branch, say featbranch, in the repo to work on a specific module, but featbranch had no meaning at all for other modules. You can imagine the mess this could cause… […]

Git Baby is a git and github fan, let's start git clone.