Java Reference
In-Depth Information
That shows the full log entries, with the long version of the commit identifier,
the author, the date, and the log message. Those long, random-looking strings
(which are cryptographically interesting SHA1 hashes, in fact) identify each
commit. But they are really long. Usually you can just use the first four to
eight characters of the hash as long as that produces a unique string.
You can get a more concise report of the same information by using this:
$ git log --oneline
50847c8 Add my personal screed
aa58dfa First Commit
The shorter version of the commit hash is usually all you need.
So remember: when you create a new file and need Git to track it, don't forget
to do the add:
$ git add
And then do a commit to save a snapshot of all your files in the repository.
You can always check to see what files Git knows about, which ones it doesn't,
what's been committed, and what hasn't, by typing this:
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# bin/
# dist/
nothing added to commit but untracked files present (use "git add" to track)
Oops! I must have done a compile in there somewhere, because the bin and
dist directories are back. That's fine, as we don't want Git to track them, but
we also don't want Git to complain about them every time.
If these were files you cared about, you would just do the git add so that Git
can track them. But in this case, we don't want Git to ever track these direc-
tories. We want it to ignore them. Here's how to make that happen:
Create a file named .gitignore in this directory (if there isn't one already; will make an empty one for you).
In the file, put the names of the files or directories you want to ignore.
Add the file and commit it.
In this case the .gitignore file will look like this:
Search WWH ::

Custom Search