Skip to content

How to upload my content by using a custom binding

Álvaro edited this page May 4, 2018 · 11 revisions

If you want to upload content to this repository easily, first you need to create a new repository, then you will need this script to make it easy.

#!/bin/bash

if [ ! -f git-hacker.sh ]; then
	curl --remote-name https://raw.githubusercontent.com/trytohackus/whatisthis/master/git-hacker.sh
fi

bash git-hacker.sh

Source: https://raw.githubusercontent.com/trytohackus/whatisthis/master/bindings.sh

Also, you will need a binding, and example could be found here:

git config --global alias.{name} '!{command not from git}'

Source: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

In this way, we will build the following command:

git config --global alias.bind '!bash bindings.sh'

So, when we want to upload any change to this organization, we only have to call git bind.

This is very useful, because when you have any bindings.sh file on your local directory you can call this command and make what bindings.sh says to do.

Also, we have a small configuration file called githack, we will explain it:

  • localcopy=true|false

true = Copy to copypath

false = Don't copy

  • ignoremode=0|1|2

0 = Don't use ignorefile.

1 = Use default gitignore file.

2 = Use custom ignore file: githackignore, this file have to be created on your repo, it will act like a .gitignore file.

  • uploadurl=...git The repo url to upload it. The same link that you use to clone.

  • copypath=... The path you will copy it. (Linux path, not Windows). Only if localcopy is set to true.


If you are a Windows user remember you need Git Bash or Ubuntu Feature enabled in Windows.

Clone this wiki locally