Join Kevin Skoglund for an in-depth discussion in this video Working with the HEAD pointer, part of Git Essential Training (2012).
In this movie we'll gain an understanding of the HEAD pointer in Git.…Git maintains a reference variable called HEAD, all capitals, H-E-A-D.…And we call this variable a pointer, because its purpose is to reference, or…point to, a specific commit in the repository as we make new commits the pointer…is going to change or move to point to a new commit.…HEAD always points to the tip of the current branch in our repository.…Now this has to do with our repository, not our staging index, or our working…directory, we're talking just about the repository the commits that we've…actually made to the repository by checking them in.…
Another way to think of it is the last state of our repository or what was last…checked out, and because it's where the repository left off or the last state,…you can also say that the HEAD points to the parent of the next commit or it's…where commit writing is going to take place.…I think a good metaphor to think about this is the playback and record head on a…cassette tape recorder.…
Author
Released
8/24/2012- Exploring the history of version control
- Installing Git on Mac, Windows, and Linux
- Initializing a repository
- Writing useful commit messages
- Understanding the Git three-tree architecture
- Tracking when files are added, edited, deleted, or moved
- Viewing change sets and comparing versions
- Undoing changes and rolling back to previous versions
- Ignoring changes to select files
- Creating and working with code branches
- Merging branches and resolving merge conflicts
- Stashing changes for later
- Working with hosted repositories and remote branches
- Developing an effective collaboration workflow
Skill Level Beginner
Duration
Views
Q: In the Chapter 10 movie "Configuring the command prompt to show the branch," when I type the function "__git_ps1," I do not get the expected result.
A: The function "__git_ps1" was recently moved to a new file, .git-prompt.sh, as described here: https://github.com/git/git/commit/af31a456b4cd38f2630ed8e556e23954f806a3cc.
We will update the video. In the meantime, you may do the same steps you do for .git-completion.bash, but a second time using ".git-prompt.sh" as shown here: https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh.
Q: When I use the code the instructor advises in the above video ("git config --global user.name "Nelda Street"), I still get an "Illegal Instruction" error. I have OS 10.6.8. Am I doing something wrong?
A: The current installer version of git isn't compatible with older Mac OS versions.
https://code.google.com/p/git-osx-installer/issues/detail?id=96
1. To add "-mmacosx-version-min=10.6" as described here:https://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10https://stackoverflow.com/questions/10177038/illegal-instruction-4-shows-up-in-os-x-lion
2. Or to use the version of git that comes with Xcode, or to use homebrew to install git instead.http://superuser.com/questions/697144/installed-git-not-sure-how-to-get-it-working
Related Courses
-
Unix for Mac OS X Users
with Kevin Skoglund6h 35m Beginner
-
Introduction
-
Introduction1m 3s
-
-
1. What is Git?
-
The history of Git7m 58s
-
Who should use Git?2m 34s
-
2. Installing Git
-
Installing Git on a Mac3m 44s
-
Installing Git on Windows5m 37s
-
Installing Git on Linux1m 30s
-
Configuring Git7m 29s
-
Using Git help2m 17s
-
-
3. Getting Started
-
Initializing a repository1m 58s
-
Writing commit messages5m 22s
-
Viewing the commit log3m 51s
-
-
4. Git Concepts and Architecture
-
The Git workflow3m 15s
-
5. Making Changes to Files
-
Adding files5m 59s
-
Editing files3m 56s
-
Viewing changes with diff3m 35s
-
Viewing only staged changes2m 28s
-
Deleting files5m 29s
-
Moving and renaming files4m 25s
-
-
6. Using Git with a Real Project
-
Initializing Git3m 48s
-
7. Undoing Changes
-
Unstaging files2m 37s
-
Amending commits4m 50s
-
Retrieving old versions4m 7s
-
Reverting a commit3m 12s
-
Using reset to undo commits3m 44s
-
Removing untracked files3m 3s
-
8. Ignoring Files
-
Using .gitignore files8m 23s
-
Understanding what to ignore4m 47s
-
Ignoring files globally4m 49s
-
Ignoring tracked files5m 26s
-
Tracking empty directories3m 57s
-
-
9. Navigating the Commit Tree
-
Referencing commits4m 52s
-
Exploring tree listings3m 46s
-
Viewing commits4m 4s
-
Comparing commits6m 31s
-
-
10. Branching
-
Branching overview4m 56s
-
Switching branches2m 58s
-
Comparing branches4m 28s
-
Renaming branches2m 28s
-
Deleting branches4m 18s
-
-
11. Merging Branches
-
Merging code3m 11s
-
Merging conflicts7m 26s
-
-
12. Stashing Changes
-
Viewing stashed changes2m 39s
-
Retrieving stashed changes4m 24s
-
Deleting stashed changes3m 26s
-
13. Remotes
-
Setting up a GitHub account5m 39s
-
Creating a remote branch4m 3s
-
Cloning a remote repository4m 26s
-
Tracking remote branches4m 5s
-
Merging in fetched changes4m 50s
-
Checking out remote branches3m 22s
-
Deleting a remote branch3m 8s
-
Enabling collaboration3m 40s
-
A collaboration workflow8m 43s
-
14. Tools and Next Steps
-
Understanding Git hosting2m 37s
-
Conclusion
-
Goodbye55s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Working with the HEAD pointer