GitStreet v0.1.0 GitStreet View Source
Documentation for GitStreet.
Link to this section Summary
Functions
List of branches
Switch branches or restore working tree files
Clone a repository into a new directory.
You can set path
option and set the name of a new directory to clone into.
Shows the commit logs.
You can set limit
option and function returns limited output of commits.
Entrypoint for further working with existing git repository.
Link to this section Functions
List of branches
Examples
iex> GitStreet.branch(%GitStreet.Repo{path: "/user/repo/path"})
["master", "release", "feature/123"]
Switch branches or restore working tree files
Examples
iex> GitStreet.checkout(%GitStreet.Repo{path: "/user/repo/path"}, "my_branch")
{:ok, "Switched to branch my_branch"}
iex> GitStreet.checkout(%GitStreet.Repo{path: "/user/repo/path"}, "nonexistent_branch")
{:ok, "Couldn`t switch to nonexistent_branch"}
Clone a repository into a new directory.
You can set path
option and set the name of a new directory to clone into.
Examples
iex> GitStreet.clone("git@provider.com:repo_name.git")
%GitStreet.Repo{path: "/current/directory/path/repo_name/.git"}
iex> GitStreet.clone("git@provider.com:repo_name.git", path: "/users/directory/path")
%GitStreet.Repo{path: "/users/directory/path/repo_name/.git"}
Shows the commit logs.
You can set limit
option and function returns limited output of commits.
Examples
iex> GitStreet.log(%GitStreet.Repo{path: "/user/repo/path"})
[%{
author_name: "Author Name",
author_email: "author.name@gmail.com",
created_at: "Tue Feb 4 14:13:37 2020 +0200",
hash: "fa6ff4e6b12b90b035671d1eb44a7762191c175c",
message: "commit message"
},
%{
....
}]
iex> GitStreet.log(%GitStreet.Repo{path: "/user/repo/path"}, limit: 1)
[%{
author_name: "Author Name",
author_email: "author.name@gmail.com",
created_at: "Tue Feb 4 14:13:37 2020 +0200",
hash: "fa6ff4e6b12b90b035671d1eb44a7762191c175c",
message: "commit message"
}]
Entrypoint for further working with existing git repository.
Examples
iex> GitStreet.open
%GitStreet.Repo{path: "/current/directory/path/.git"}
iex> GitStreet.open("/user/repo/path")
%GitStreet.Repo{path: "/user/repo/path/.git"}