Book description
Whether you're relatively new to git or you need a refresher, or if you just need a quick, handy reference for common tasks in git, Git Recipes is just the reference book you need.
With recipes to cover any task you can think of, including working with GitHub and git on BitBucket, Git Recipes shows you how to work with large repositories, new repositories, forks, clones, conflicts, differences, and it even gives you practical scenarios you may find yourself dealing with while using git.
If you work with Git at all, you need this hands-on, practical reference for all things Git.
What you'll learn
How to work with both well-known and local repositories
How to deal with issues like dangling revisions and disjointed branches
How to pinpoint who made specific changes
How to deal with textual and binary conflicts
How to work with hosted solutions like GitHub and BitBucket
How to work with git in large groups
Who this book is for
People who need a quick, practical reference for everything related to Git.
Table of contents
- Title Page
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- CHAPTER 1: Getting Started with Git
-
CHAPTER 2: Working with Well-Known Repositories
- 2-1. Cloning a repository hosted on Github
- 2-2. Cloning a repository hosted on Bitbucket
- 2-3. Cloning a local repository
- 2-4. Copying a local repository
- 2-5. Exploring the contents of a git repository
- 2-6. Deleting and restoring the contents of the working directory
- 2-7. Cloning a bare repository
- 2-8. Exploring the history with a git log command
- 2-9. Analyzing a repository with git log and shortlog commands
- 2-10. Defining aliases for the commands discussed in Recipes 2-8 and 2-9
- 2-11. Analyzing one of the popular repositories
- 2-12. Visualizing the history of a repository
- 2-13. Removing a .git directory
- Summary
-
CHAPTER 3: Creating Local Repositories with Linear History
- 3-1. Creating your first repository
- 3-2. Creating the git snapshot alias
- 3-3. Using the git snapshot alias in your daily work
- 3-4. Mapping names
- 3-5. Restoring revisions with git reset
- 3-6. Restoring revisions with git checkout
- 3-7. Creating a git s alias
- 3-8. Working with reflog
- 3-9. Creating a new repository in an existing project
- 3-10. Losing uncommitted changes
- 3-11. Creating a git simple-commit alias
- 3-12. Loosing commits
- Summary
-
CHAPTER 4: Managing Files
- 4-1. Staging and committing a new file
- 4-2. Staging and committing a modified file
- 4-3. Committing a modified file
- 4-4. Staging and committing a removed file
- 4-5. Committing a file removed with the standard rm command
- 4-6. Converting an unmodified file into an untracked file
- 4-7. Staging and committing a file renamed with git mv
- 4-8. Committing a file renamed with the standard mv command
- 4-9. Staging all files
- 4-10. Working with mixed states
- Summary
-
CHAPTER 5: Branches
- 5-1. Creating and switching branches
- 5-2. Cloning a repository with branches
- 5-3. Creating a clone-with-branches alias
- 5-4. Committing in a detached HEAD state
- 5-5. Resetting and cleaning a branch
- 5-6. Switching branches in a dirty repository without conflicts
- 5-7. Switching branches in a dirty repository with conflicts
- 5-8. Committing in a wrong branch
- 5-9. Deleting local branches
- 5-10. Using a branch as a backup
- 5-11. Renaming branches
- 5-12. Checking out a file from a different branch
- 5-13. Switching branches in a bare repository
- Summary
- CHAPTER 6: Merging Branches
-
CHAPTER 7: Rebasing Branches
- 7-1. Rebasing divergent branches
- 7-2. Manually rebasing divergent branches
- 7-3. Joining divergent branches into linear history
- 7-4. Diverging three branches
- 7-5. Partial rebasing
- 7-6. Creating bulbs for divergent branches
- 7-7. Creating bulbs in subbranches
- 7-8. Rebasing branches with bulbs
- 7-9. Preserving merges during rebase
- Summary
-
CHAPTER 8: Modifying the History
- 8-1. Amending the most recent revision
- 8-2. Removing n most recent revisions
- 8-3. Squashing many revisions into one revision
- 8-4. Splitting one revision into many revisions
- 8-5. Reordering revisions
- 8-6. Removing several revisions
- 8-7. Editing an old revision
- 8-8. Reverting revisions
- 8-9. Reverting merge commit revisions
- 8-10. Cherry-picking revisions
- 8-11. Squashing a branch
- 8-12. Re-using a reverted branch
- Summary
-
CHAPTER 9: Resolving Conflicts
- 9-1. Creating conflicting changes in text files
- 9-2. Resolving textual conflict after merging
- 9-3. Resolving textual conflict after rebasing
- 9-4 Creating conflicting changes in binary files
- 9-5. Resolving a binary conflict during merging
- 9-6. Resolving a binary conflict during rebasing
- 9-7. Forcing a binary mode during merge
- Summary
-
CHAPTER 10: Remote Repositories and Synchronization
- 10-1. Manual cloning
- 10-2. Coworking with a central repository
- 10-3. Generating (n-1) merge commits for one commit
- 10-4. Keeping the history linear
- 10-5. Coworking without a central repository
- 10-6. Working with remote branches
- 10-7. Using remote branches for contributions
- 10-8. Accepting contributions
- 10-9. Appending commits to a remote branch
- 10-10. Rewriting history with $ git push -f
- 10-11. Finishing the work on the remote branch
- 10-12. Pushing to non-bare repositories
- Summary
-
CHAPTER 11: Hosting git Git Repositories
- 11-1. Installing VirtualBox and Vagrant
- 11-2. Running virtual Linux
- 11-3. Compiling git on a virtual machine
- 11-4. Hosting git repositories over ssh
- 11-5. Simplifying ssh authorization with authorized_keys
- 11-6. Hosting git repositories with git daemon
- 11-7. Hosting git repositories over http
- 11-8. Using Gitweb CGI application
- 11-9. Using a cgit CGI application
- 11-10. Working with gitolite
- Summary
-
CHAPTER 12: Working with Github.com
- 12-1. Creating a Github account
- 12-2. Configuring a Github account with SSH keys
- 12-3. Creating a Github-hosted repository for a new project
- 12-4. Creating a Github-hosted repository for an existing project
- 12-5. Creating an organization account on Github
- 12-6. Creating a new project hosted by an organization
- 12-7. Sending pull requests
- 12-8. Reworking your pull requests
- 12-9. Accepting a pull request
- How It Works
- Summary
-
CHAPTER 13: More Recipes
- 13-1. Working with the $ git diff command
- 13-2. Committing files without line-ending conversion
- 13-3. Checking out files without line-ending conversion
- 13-4. Converting line endings to CRLF in the working directory during checkout and committing the change
- 13-5. Converting line endings to LF and committing the change
- 13-6. Unintended conversion of all line endings
- 13-7. Defining line endings for individual files and directories
- 13-8. Ignoring automatically generated files
- 13-9. Customizing a project with .dist files
- 13-10. Using the .git/info/exclude file
- 13-11. Using tags
- 13-12. Exporting repositories to zipped archives
- Summary
- Index
Product information
- Title: Git Recipes: A Problem-Solution Approach
- Author(s):
- Release date: December 2013
- Publisher(s): Apress
- ISBN: 9781430261032
You might also like
book
Git Version Control Cookbook
A series of practical recipes to simplify the Git learning experience and increase your productivity when …
book
Git Essentials
Create, merge, and distribute code with Git, the most powerful and flexible versioning system available In …
book
Pragmatic Guide to Git
Need to learn how to wrap your head around Git, but don't need a lot of …
book
Pragmatic Version Control Using Git
There's a change in the air. High-profile projects such as the Linux Kernel, Mozilla, Gnome, and …