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/01-introduction/sections/command-line.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
@@ -7,5 +7,5 @@ For one, the command line is the only place you can run _all_ Git commands -- mo
7
7
If you know how to run the command-line version, you can probably also figure out how to run the GUI version, while the opposite is not necessarily true.
8
8
Also, while your choice of graphical client is a matter of personal taste, _all_ users will have the command-line tools installed and available.
9
9
10
-
So we will expect you to know how to open Terminal in Mac or Command Prompt or Powershell in Windows.
10
+
So we will expect you to know how to open Terminal in macOS or Command Prompt or PowerShell in Windows.
11
11
If you don't know what we're talking about here, you may need to stop and research that quickly so that you can follow the rest of the examples and descriptions in this book.
Copy file name to clipboardExpand all lines: book/01-introduction/sections/installing.asc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ $ sudo apt install git-all
31
31
32
32
For more options, there are instructions for installing on several different Unix distributions on the Git website, at http://git-scm.com/download/linux[].
33
33
34
-
==== Installing on Mac
34
+
==== Installing on macOS
35
35
36
36
(((Mac, installing)))
37
37
There are several ways to install Git on a Mac.
@@ -67,7 +67,7 @@ Note that the Chocolatey package is community maintained.
67
67
68
68
Another easy way to get Git installed is by installing GitHub Desktop.
69
69
The installer includes a command line version of Git as well as the GUI.
70
-
It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.(((Powershell)))(((CRLF)))(((credential caching)))
70
+
It also works well with PowerShell, and sets up solid credential caching and sane CRLF settings.(((PowerShell)))(((CRLF)))(((credential caching)))
71
71
We'll learn more about those things a little later, but suffice it to say they're things you want.
72
72
You can download this from the https://desktop.github.com/[GitHub Desktop website].
Copy file name to clipboardExpand all lines: book/A-git-in-other-environments/sections/guis.asc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Each of them is tailored for a specific purpose (viewing history and creating co
69
69
==== GitHub for Mac and Windows
70
70
71
71
(((GitHub for Mac)))(((GitHub for Windows)))
72
-
GitHub has created two workflow-oriented Git clients: one for Windows, and one for Mac.
72
+
GitHub has created two workflow-oriented Git clients: one for Windows, and one for macOS.
73
73
These clients are a good example of workflow-oriented tools – rather than expose _all_ of Git's functionality, they instead focus on a curated set of commonly-used features that work well together.
74
74
They look like this:
75
75
@@ -84,7 +84,7 @@ We won't be doing a detailed rundown of these tools (they have their own documen
84
84
85
85
* On the left is the list of repositories the client is tracking; you can add a repository (either by cloning or attaching locally) by clicking the ``+'' icon at the top of this area.
86
86
* In the center is a commit-input area, which lets you input a commit message, and select which files should be included.
87
-
(On Windows, the commit history is displayed directly below this; on Mac, it's on a separate tab.)
87
+
(On Windows, the commit history is displayed directly below this; on macOS, it's on a separate tab.)
88
88
* On the right is a diff view, which shows what's changed in your working directory, or which changes were included in the selected commit.
89
89
* The last thing to notice is the ``Sync'' button at the top-right, which is the primary way you interact over the network.
90
90
@@ -101,7 +101,7 @@ When the applications are first run, they walk you through all the first-time Gi
101
101
102
102
Both are ``evergreen'' – updates are downloaded and installed in the background while the applications are open.
103
103
This helpfully includes a bundled version of Git, which means you probably won't have to worry about manually updating it again.
104
-
On Windows, the client includes a shortcut to launch Powershell with Posh-git, which we'll talk more about later in this chapter.
104
+
On Windows, the client includes a shortcut to launch PowerShell with Posh-git, which we'll talk more about later in this chapter.
105
105
106
106
The next step is to give the tool some repositories to work with.
107
107
The client shows you a list of the repositories you have access to on GitHub, and can clone them in one step.
@@ -114,10 +114,10 @@ The intended workflow for this tool is sometimes called the ``GitHub Flow.''
114
114
We cover this in more detail in <<ch06-github#ch06-github_flow>>, but the general gist is that (a) you'll be committing to a branch, and (b) you'll be syncing up with a remote repository fairly regularly.
115
115
116
116
Branch management is one of the areas where the two tools diverge.
117
-
On Mac, there's a button at the top of the window for creating a new branch:
117
+
On macOS, there's a button at the top of the window for creating a new branch:
118
118
119
-
.``Create Branch'' button on Mac.
120
-
image::images/branch_widget_mac.png[``Create Branch'' button on Mac.]
119
+
.``Create Branch'' button on macOS.
120
+
image::images/branch_widget_mac.png[``Create Branch'' button on macOS.]
121
121
122
122
On Windows, this is done by typing the new branch's name in the branch-switching widget:
The legacy command-line terminal on Windows (`cmd.exe`) isn't really capable of a customized Git experience, but if you're using Powershell, you're in luck.
6
+
The legacy command-line terminal on Windows (`cmd.exe`) isn't really capable of a customized Git experience, but if you're using PowerShell, you're in luck.
7
7
This also works if you're running PowerShell on a non-Windows platform like Debian.
8
8
A package called Posh-Git (https://github.com/dahlbyk/posh-git[]) provides powerful tab-completion facilities, as well as an enhanced prompt to help you stay on top of your repository status.
9
9
It looks like this:
10
10
11
-
.Powershell with Posh-git.
12
-
image::images/posh-git.png[Powershell with Posh-git.]
11
+
.PowerShell with Posh-git.
12
+
image::images/posh-git.png[PowerShell with Posh-git.]
13
13
14
14
==== Installation
15
15
===== Prerequisites (Windows only)
@@ -45,7 +45,7 @@ If the second command fails with an error like `Module 'PowerShellGet' was not i
45
45
----
46
46
47
47
Then you can go back and try again.
48
-
This happens, because the modules that ship with Windows Powershell are signed with a different publishment certificate.
48
+
This happens, because the modules that ship with Windows PowerShell are signed with a different publishment certificate.
49
49
50
50
===== Update PowerShell Prompt
51
51
To include git information in your prompt, posh-git needs to be imported. To do this automatically, include the import statement into you $profile script. This script is executed everytime you open a new PowerShell prompt.
@@ -57,8 +57,8 @@ Keep in mind, that there are multiple $profile scripts. E. g. one for the consol
57
57
-----
58
58
59
59
===== From Source
60
-
Just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowershell` directory.
61
-
Then open a Powershell prompt as an administrator, and do this:
60
+
Just download a Posh-Git release from (https://github.com/dahlbyk/posh-git[]), and uncompress it to the `WindowsPowerShell` directory.
61
+
Then open a PowerShell prompt as an administrator, and do this:
62
62
[source,powershell]
63
63
-----
64
64
> cd ~\Documents\WindowsPowerShell\Module\posh-git
0 commit comments