Skip to content

Commit cb08496

Browse files
committed
Cleaning up GIT bindings
1 parent 653d80e commit cb08496

30 files changed

+438
-4
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Function; Git Add Remote
2+
FUNCTION ==> git-remote-add
3+
4+
Adds a remote upstream to the specified local repo.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/git-remote-add.hl]:
8+
{
9+
"path": "[STRING_VALUE]",
10+
"url": "[STRING_VALUE]"
11+
}
12+
___
13+
14+
## Arguments
15+
16+
* `path` is the mandatory folder of where your repository is.
17+
* `url` is the mandatory URL for the Git repo.
18+
19+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".
20+

backend/files/misc/common-startup-files/default-files/functions/git/git-checkout-branch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ ___
1818
* `branch` is the mandatory branch you want to checkout.
1919
* `create` is an optional boolean, which if true, creates a new branch.
2020

21-
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `folder` argument must point inside of "/etc/" or "/modules/".
21+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".

backend/files/misc/common-startup-files/default-files/functions/git/git-clone-repo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ ___
2020
* `branch` is the mandatory branch you want to initially checkout.
2121
* `create` is an optional boolean, which if true, creates a new branch.
2222

23-
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `folder` argument must point inside of "/etc/" or "/modules/". Paths must **ALWAYS** start and end with "/".
23+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/". Paths must **ALWAYS** start and end with "/".
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Function; Git Commit
2+
FUNCTION ==> git-commit
3+
4+
Commits all changes to the local Git repository.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/git-commit.hl]:
8+
{
9+
"path": "[STRING_VALUE]",
10+
"message": "[STRING_VALUE]"
11+
}
12+
___
13+
14+
## Arguments
15+
16+
* `path` is the mandatory folder of where your repository is.
17+
* `message` is the mandatory message for the commit.
18+
19+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".
20+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Function; Git Create Repo
2+
FUNCTION ==> git-create-repo
3+
4+
Creates and initialises a new Git repository locally.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/git-create-repo.hl]:
8+
{
9+
"path": "[STRING_VALUE]",
10+
"branch": "[STRING_VALUE]"
11+
}
12+
___
13+
14+
## Arguments
15+
16+
* `path` is the mandatory folder of where your repository is.
17+
* `branch` is the mandatory default branch for repository.
18+
19+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".
20+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Function; Git Delete Repo
2+
FUNCTION ==> git-delete-repo
3+
4+
Deletes an existing Git repository on the local machine.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/git-delete-repo.hl]:
8+
{
9+
"path": "[STRING_VALUE]"
10+
}
11+
___
12+
13+
## Arguments
14+
15+
* `path` is the mandatory folder of where your repository is.
16+
17+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".
18+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Function; Git Push
2+
FUNCTION ==> git-push
3+
4+
Pushes all changes to Git repository upstreams.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/git-push.hl]:
8+
{
9+
"path": "[STRING_VALUE]",
10+
"remote": "[STRING_VALUE]",
11+
"branch": "[STRING_VALUE]"
12+
}
13+
___
14+
15+
## Arguments
16+
17+
* `path` is the mandatory folder of where your repository is.
18+
* `remote` is optional remote value. Defaults to 'origin'.
19+
* `branch` is optional branch to push. Defaults to 'main'.
20+
21+
Notice, you can only save files in the "/etc/" and "/modules/" folders, so the `path` argument must point inside of "/etc/" or "/modules/".
22+
23+
Notice, before pushing a repo the repo must have a remote. You can add a remote upstream using the `git.remote.add` function.
24+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Function; GitHub Create Repo
2+
FUNCTION ==> github-create-repo
3+
4+
Creates and initialises a new GitHub repository on GitHub's servers.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/github-create-repo.hl]:
8+
{
9+
"name": "[STRING_VALUE]"
10+
}
11+
___
12+
13+
## Arguments
14+
15+
* `name` is the mandatory name of your new project.
16+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Function; GitHub Delete Repo
2+
FUNCTION ==> github-delete-repo
3+
4+
Creates and initialises a new GitHub repository on GitHub's servers.
5+
6+
___
7+
FUNCTION_INVOCATION[/misc/workflows/workflows/git/github-delete-repo.hl]:
8+
{
9+
"name": "[STRING_VALUE]"
10+
}
11+
___
12+
13+
## Arguments
14+
15+
* `name` is the mandatory GitHub project name.
16+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
How to use Git and GitHub
2+
3+
Magic contains a whole range of function related to Git. You can find a complete list below. However, before you can use Git or GitHub, you will have to add configuration settings for it resembling the following;
4+
5+
```json
6+
{
7+
"magic": {
8+
"git": {
9+
"github": {
10+
"username": "YOUR_GIT_AND_GITHUB_USERNAME",
11+
"token": "github_pat_YOUR_GITHUB_TOKEN_HERE",
12+
"host": "github.com"
13+
}
14+
},
15+
/* ... rest of file ... */
16+
```
17+
18+
You will need to exchange the above `username` and `token` parts. To get a token, you can go to "https://github.com/settings/personal-access-tokens" and create a new token. When you create it you should create it with access to _"All repositories"_ in addition to granting it both read and write permissions to _"Administration"_ and _"Contents"_

0 commit comments

Comments
 (0)