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: book/04-git-server/sections/hosted.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
@@ -2,7 +2,7 @@
2
2
3
3
If you don't want to go through all of the work involved in setting up your own Git server, you have several options for hosting your Git projects on an external dedicated hosting site.
4
4
Doing so offers a number of advantages: a hosting site is generally quick to set up and easy to start projects on, and no server maintenance or monitoring is involved.
5
-
Even if you set up and run your own server internally, you may still want to use a public hosting site for your open source code – it's generally easier for the open source community to find and help you with.
5
+
Even if you set up and run your own server internally, you may still want to use a public hosting site for your open source code -- it's generally easier for the open source community to find and help you with.
6
6
7
7
These days, you have a huge number of hosting options to choose from, each with different advantages and disadvantages.
8
8
To see an up-to-date list, check out the GitHosting page on the main Git wiki at https://git.wiki.kernel.org/index.php/GitHosting[].
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/credentials.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
@@ -4,7 +4,7 @@
4
4
(((credentials)))
5
5
(((git commands, credential)))
6
6
If you use the SSH transport for connecting to remotes, it's possible for you to have a key without a passphrase, which allows you to securely transfer data without typing in your username and password.
7
-
However, this isn't possible with the HTTP protocols – every connection needs a username and password.
7
+
However, this isn't possible with the HTTP protocols -- every connection needs a username and password.
8
8
This gets even harder for systems with two-factor authentication, where the token you use for a password is randomly generated and unpronounceable.
9
9
10
10
Fortunately, Git has a credentials system that can help with this.
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/submodules.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
@@ -415,7 +415,7 @@ Submodules changed but not updated:
415
415
no changes added to commit (use "git add" and/or "git commit -a")
416
416
----
417
417
418
-
By default, the `git pull` command recursively fetches submodules changes, as we can see in the output of the first command above.
418
+
By default, the `git pull` command recursively fetches submodules changes, as we can see in the output of the first command above.
419
419
However, it does not *update* the submodules.
420
420
This is shown by the output of the `git status` command, which shows the submodule is "`modified`", and has "`new commits`".
421
421
What's more, the brackets showing the new commits point left (<), indicating that these commits are recorded in MainProject but are not present in the local DbConnector checkout.
@@ -500,7 +500,7 @@ Submodule path 'DbConnector': merged in '92c7337b30ef9e0893e758dac2459d07362ab5e
500
500
----
501
501
502
502
If we go into the DbConnector directory, we have the new changes already merged into our local `stable` branch.
503
-
Now let's see what happens when we make our own local change to the library and someone else pushes another change upstream at the same time.
503
+
Now let's see what happens when we make our own local change to the library and someone else pushes another change to the upstream at the same time.
504
504
505
505
[source,console]
506
506
----
@@ -608,7 +608,7 @@ to push them to a remote.
608
608
609
609
As you can see, it also gives us some helpful advice on what we might want to do next.
610
610
The simple option is to go into each submodule and manually push to the remotes to make sure they're externally available and then try this push again.
611
-
If you want the check behavior to happen for all pushes, you can make this behavior the default by doing `git config push.recurseSubmodules check`.
611
+
If you want the "`check`" behavior to happen for all pushes, you can make this behavior the default by doing `git config push.recurseSubmodules check`.
612
612
613
613
The other option is to use the "`on-demand`" value, which will try to do this for you.
614
614
@@ -973,7 +973,7 @@ Indeed, if you switch between branches that record the submodule at different co
973
973
That is because the submodule state is by default not carried over when switching branches.
974
974
975
975
This can be really confusing, so it's a good idea to always `git checkout --recurse-submodules` when your project has submodules.
976
-
For older Git versions that do not have the `--recurse-submodules` flag, after the checkout you can use `git submodule update --init --recursive` to put the submodules in the right state.
976
+
For older Git versions that do not have the `--recurse-submodules` flag, after the checkout you can use `git submodule update --init --recursive` to put the submodules in the right state.
977
977
978
978
Luckily, you can tell Git (>=2.14) to always use the `--recurse-submodules` flag by setting the configuration option `submodule.recurse`: `git config submodule.recurse true`.
979
979
As noted above, this will also make Git recurse into submodules for every command that has a `--recurse-submodules` option (except `git clone`).
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/subtree-merges.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ We just switched back to your `master` branch, and we pull the `rack_branch` bra
57
57
$ git read-tree --prefix=rack/ -u rack_branch
58
58
----
59
59
60
-
When we commit, it looks like we have all the Rack files under that subdirectory – as though we copied them in from a tarball.
60
+
When we commit, it looks like we have all the Rack files under that subdirectory -- as though we copied them in from a tarball.
61
61
What gets interesting is that we can fairly easily merge changes from one of the branches to the other.
62
62
So, if the Rack project updates, we can pull in upstream changes by switching to that branch and pulling:
63
63
@@ -80,14 +80,14 @@ Automatic merge went well; stopped before committing as requested
80
80
----
81
81
82
82
All the changes from the Rack project are merged in and ready to be committed locally.
83
-
You can also do the opposite – make changes in the `rack` subdirectory of your `master` branch and then merge them into your `rack_branch` branch later to submit them to the maintainers or push them upstream.
83
+
You can also do the opposite -- make changes in the `rack` subdirectory of your `master` branch and then merge them into your `rack_branch` branch later to submit them to the maintainers or push them upstream.
84
84
85
85
This gives us a way to have a workflow somewhat similar to the submodule workflow without using submodules (which we will cover in <<ch07-git-tools#_git_submodules>>).
86
86
We can keep branches with other related projects in our repository and subtree merge them into our project occasionally.
87
87
It is nice in some ways, for example all the code is committed to a single place.
88
88
However, it has other drawbacks in that it's a bit more complex and easier to make mistakes in reintegrating changes or accidentally pushing a branch into an unrelated repository.
89
89
90
-
Another slightly weird thing is that to get a diff between what you have in your `rack` subdirectory and the code in your `rack_branch` branch – to see if you need to merge them – you can't use the normal `diff` command.
90
+
Another slightly weird thing is that to get a diff between what you have in your `rack` subdirectory and the code in your `rack_branch` branch -- to see if you need to merge them -- you can't use the normal `diff` command.
91
91
Instead, you must run `git diff-tree` with the branch you want to compare to:
0 commit comments