You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: C-git-commands.asc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ We first introduce this in <<ch02-git-basics-chapter#_getting_a_repo>>, where we
99
99
100
100
We talk briefly about how you can change the default branch name from "`master`" in <<ch03-git-branching#_remote_branches>>.
101
101
102
-
We use this command to create an empty bare repository for a server in <<ch04-git-on-the-server#_bare_repo>>.
102
+
We use this command to create an empty bare repository for a server in <<ch04-git-on-the-server#r_bare_repo>>.
103
103
104
104
Finally, we go through some of the details of what it actually does behind the scenes in <<ch10-git-internals#_plumbing_porcelain>>.
105
105
@@ -161,7 +161,7 @@ We use it to look for possible whitespace issues before committing with the `--c
161
161
162
162
We see how to check the differences between branches more effectively with the `git diff A...B` syntax in <<ch05-distributed-git#_what_is_introduced>>.
163
163
164
-
We use it to filter out whitespace differences with `-b` and how to compare different stages of conflicted files with `--theirs`, `--ours` and `--base` in <<ch07-git-tools#_advanced_merging>>.
164
+
We use it to filter out whitespace differences with `-b` and how to compare different stages of conflicted files with `--theirs`, `--ours` and `--base` in <<ch07-git-tools#r_advanced_merging>>.
165
165
166
166
Finally, we use it to effectively compare submodule changes with `--submodule` in <<ch07-git-tools#_starting_submodules>>.
167
167
@@ -196,7 +196,7 @@ We first effectively cover the simplest use of `git reset` in <<ch02-git-basics-
196
196
197
197
We then cover it in quite some detail in <<ch07-git-tools#_git_reset>>, which is entirely devoted to explaining this command.
198
198
199
-
We use `git reset --hard` to abort a merge in <<ch07-git-tools#_abort_merge>>, where we also use `git merge --abort`, which is a bit of a wrapper for the `git reset` command.
199
+
We use `git reset --hard` to abort a merge in <<ch07-git-tools#r_abort_merge>>, where we also use `git merge --abort`, which is a bit of a wrapper for the `git reset` command.
200
200
201
201
==== git rm
202
202
@@ -261,7 +261,7 @@ Though it is used in various places in the book, there are very few variations o
261
261
262
262
We covered how to do a squashed merge (where Git merges the work but pretends like it's just a new commit without recording the history of the branch you're merging in) at the very end of <<ch05-distributed-git#_public_project>>.
263
263
264
-
We went over a lot about the merge process and command, including the `-Xignore-space-change` command and the `--abort` flag to abort a problem merge in <<ch07-git-tools#_advanced_merging>>.
264
+
We went over a lot about the merge process and command, including the `-Xignore-space-change` command and the `--abort` flag to abort a problem merge in <<ch07-git-tools#r_advanced_merging>>.
265
265
266
266
We learned how to verify signatures before merging if your project is using GPG signing in <<ch07-git-tools#_signing_commits>>.
267
267
@@ -395,7 +395,7 @@ This command is only mentioned and entirely covered in <<ch07-git-tools#_git_sub
395
395
The `git show` command can show a Git object in a simple and human readable way.
396
396
Normally you would use this to show the information about a tag or a commit.
397
397
398
-
We first use it to show annotated tag information in <<ch02-git-basics-chapter#_annotated_tags>>.
398
+
We first use it to show annotated tag information in <<ch02-git-basics-chapter#r_annotated_tags>>.
399
399
400
400
Later we use it quite a bit in <<ch07-git-tools#_revision_selection>> to show the commits that our various revision selections resolve to.
Copy file name to clipboardExpand all lines: book/B-embedding-git/sections/jgit.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ Ref objects are also used to represent tag refs and objects, so you can ask if t
97
97
98
98
The second line gets the target of the `master` reference, which is returned as an ObjectId instance.
99
99
ObjectId represents the SHA-1 hash of an object, which might or might not exist in Git's object database.
100
-
The third line is similar, but shows how JGit handles the rev-parse syntax (for more on this, see <<ch07-git-tools#_branch_references>>); you can pass any object specifier that Git understands, and JGit will return either a valid ObjectId for that object, or `null`.
100
+
The third line is similar, but shows how JGit handles the rev-parse syntax (for more on this, see <<ch07-git-tools#r_branch_references>>); you can pass any object specifier that Git understands, and JGit will return either a valid ObjectId for that object, or `null`.
101
101
102
102
The next two lines show how to load the raw contents of an object.
103
103
In this example, we call `ObjectLoader.copyTo()` to stream the contents of the object directly to stdout, but ObjectLoader also has methods to read the type and size of an object, as well as return it as a byte array.
Copy file name to clipboardExpand all lines: book/B-embedding-git/sections/libgit2.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ The `git_repository` type represents a handle to a repository with a cache in me
35
35
This is the simplest method, for when you know the exact path to a repository's working directory or `.git` folder.
36
36
There's also the `git_repository_open_ext` which includes options for searching, `git_clone` and friends for making a local clone of a remote repository, and `git_repository_init` for creating an entirely new repository.
37
37
38
-
The second chunk of code uses rev-parse syntax (see <<ch07-git-tools#_branch_references>> for more on this) to get the commit that HEAD eventually points to.
38
+
The second chunk of code uses rev-parse syntax (see <<ch07-git-tools#r_branch_references>> for more on this) to get the commit that HEAD eventually points to.
39
39
The type returned is a `git_object` pointer, which represents something that exists in the Git object database for a repository.
40
40
`git_object` is actually a "`parent`" type for several different kinds of objects; the memory layout for each of the "`child`" types is the same as for `git_object`, so you can safely cast to the right one.
41
41
In this case, `git_object_type(commit)` would return `GIT_OBJ_COMMIT`, so it's safe to cast to a `git_commit` pointer.
0 commit comments