-
Notifications
You must be signed in to change notification settings - Fork 534
_examples: improve documentation (fix #238) #293
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ import ( | |
. "srcd.works/go-git.v4/_examples" | ||
) | ||
|
||
// Example of how to open a repository in a specific path, and do a push to | ||
// his default remote (origin). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
func main() { | ||
CheckArgs("<repository-path>") | ||
path := os.Args[1] | ||
|
@@ -15,6 +17,7 @@ func main() { | |
CheckIfError(err) | ||
|
||
Info("git push") | ||
// push using default push options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
err = r.Push(&git.PushOptions{}) | ||
CheckIfError(err) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,13 @@ import ( | |
"srcd.works/go-git.v4/storage/memory" | ||
) | ||
|
||
// Example of how to: | ||
// - Create a new repository into memory | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// - Create a new remote called "example" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// - List remotes and print them | ||
// - Pull using the new remote "example" | ||
// - Iterate again the references, but only showing hash references, not simbolic ones | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// - Remove remote "example" | ||
func main() { | ||
// Create a new repository | ||
Info("git init") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do a push
->push