File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 41
41
42
42
` @git.log(20).object("some_file").since("2 weeks ago").between('v2.6', 'v2.7').each { |commit| [block] } `
43
43
44
+ ** Git::Worktrees** - Enumerable object that holds ` Git::Worktree objects ` .
45
+
44
46
## Examples
45
47
46
48
Here are a bunch of examples of how to use the Ruby/Git package.
@@ -145,6 +147,14 @@ Here are the operations that need read permission only.
145
147
puts file_diff.blob(:src ).contents
146
148
end
147
149
150
+ g.worktrees # returns Git::Worktree objects
151
+ g.worktrees.count
152
+ g.worktrees.each do |worktree |
153
+ worktree.dir
154
+ worktree.gcommit
155
+ worktree.to_s
156
+ end
157
+
148
158
g.config(' user.name' ) # returns 'Scott Chacon'
149
159
g.config # returns whole config hash
150
160
@@ -252,6 +262,11 @@ And here are the operations that will need to write to your git repository.
252
262
253
263
g.push
254
264
g.push(g.remote(' name' ))
265
+
266
+ g.worktree(' /tmp/new_worktree' ).add
267
+ g.worktree(' /tmp/new_worktree' , ' branch1' ).add
268
+ g.worktree(' /tmp/new_worktree' ).remove
269
+ g.worktrees.prune
255
270
```
256
271
257
272
Some examples of more low-level index and tree operations
You can’t perform that action at this time.
0 commit comments