@@ -72,15 +72,6 @@ Let's see what the recent history of this branch looks like.
72
72
await git .log ({fs, dir})
73
73
```
74
74
75
- Notice if you expand the very last log object you'll see it is actually an error message.
76
- That's because we only fetched 10 commits of history - we don't have the 11th commit.
77
-
78
- If we don't want that error at the end of the array, we can tell git.log exactly how deep to go:
79
-
80
- ``` js live
81
- await git .log ({fs, dir, depth: $input ((10 ))})
82
- ```
83
-
84
75
Git is used to track files. Let's see what kind of file things we can do!
85
76
86
77
git.status is a major one. That let's us compare the working directory file to the current branch.
@@ -97,8 +88,8 @@ await pfs.writeFile(`${dir}/README.md`, 'Very short README', 'utf8')
97
88
await git .status ({fs, dir, filepath: ' README.md' })
98
89
```
99
90
100
- The status is "* modified" with a star.
101
- Text editors sometimes use a "* " in the title bar to indicate a file has unsaved changes.
91
+ The status is "\ * modified" with a star.
92
+ Text editors sometimes use a "\ * " in the title bar to indicate a file has unsaved changes.
102
93
That's what is going on here - we've made changes to the file but we haven't added those changes to the git "staging area".
103
94
104
95
``` js live
@@ -115,7 +106,7 @@ await pfs.writeFile(`${dir}/newfile.txt`, 'Hello World', 'utf8')
115
106
await git .status ({fs, dir, filepath: ' newfile.txt' })
116
107
```
117
108
118
- "* added" means the file has been added, but not staged. Simple to fix:
109
+ "\ * added" means the file has been added, but not staged. Simple to fix:
119
110
120
111
``` js live
121
112
await git .add ({fs, dir, filepath: ' newfile.txt' })
@@ -174,6 +165,7 @@ commits = await git.log({fs, dir, depth: 1})
174
165
commits[0 ]
175
166
```
176
167
168
+ <!--
177
169
I just had a brilliant idea. What if instead of starting out cloning `isomorphic-git`
178
170
I had you the user create a new Github repo at the beginning with a default 'LICENSE.md' and 'README.md'?
179
171
Then we could actually push the changes we've made here in this last step.
@@ -182,3 +174,4 @@ When you create the repo, I'll have to add instructions for creating an access t
182
174
you can push the results. Wait, Github doesn't allow you to specify write permissions for an individual repo?
183
175
Grr now they'll have to create an organization... wait that's a permanent name thing... ugh. I need
184
176
to build a bot to automate this thing. It can create the repo, then give *you* access to it. Or something.
177
+ -->
0 commit comments