Pushing Your First Permanent Repository
Now that you have the permagit CLI installed and your wallet connected, it's time to permanently push your local Git repository to Arweave.
1. Funding Your Arweave Storage (via Irys)
Storing data on Arweave requires a small, one-time "storage fee." Permagit handles this process using Irys, which allows you to pay for storage using SOL (among other tokens).
You can check your balance and fund your account directly from the CLI.
1-1. Check Your Balance
First, check the current balance associated with your wallet's Irys account:
Bash
permagit irys --statusIf this is your first time, your balance will be 0.
1-2. Fund Your Account
To upload repositories, you must add funds to your Irys account. For example, to fund your account with 0.1 SOL, run:
permagit irys --fund 0.1This command uses your local wallet (set up in Page 3) to send 0.1 SOL to the Irys node. This balance will be used to pay for all future permagit push operations. Arweave's storage costs are extremely low, so 0.1 SOL can store a significant amount of code.
2. Prepare Your Local Git Repository
permagit works on any existing Git repository. Whether it's a new or existing project, just make sure you have your changes committed with git.
# 1. (If new) Create a folder and initialize git
mkdir my-permanent-project
cd my-permanent-project
git init
# 2. Create a file and make your first commit
echo "Hello Permaweb" > README.md
git add .
git commit -m "Initial commit"3. Initialize Permagit
Now, you need to set up permagit within your local repository. From the root directory of your repo, run:
permagit initThis command configures Git's remote settings. It's equivalent to telling Git about a new remote location named permagit. If you run git remote -v, you will see the permagit remote listed.
4. Push to Arweave
You are all set. To permanently push your local repository to Arweave, you use the standard git push command, but target the permagit remote:
git push permagit main(Note: If your default branch is master, use git push permagit master instead.)
What's Happening Under the Hood?
When you run git push permagit, the CLI automatically performs the following steps:
Bundles Git Objects: It compresses all commits, trees, and files (blobs) from your local
.gitdirectory into a single bundle.Uploads to Irys: It sends this bundled data to the Irys node.
Posts to Arweave: Irys permanently posts the data to the Arweave network.
Returns Transaction ID: It returns the Arweave Transaction ID (TX ID) that gives you permanent access to this snapshot of your repository.
A successful push will look something like this:
Pushing to permagit (Arweave via Irys)...
Bundling 15 git objects...
Funding upload...
Upload complete!
Arweave Transaction ID: aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890-aBc
Branch 'main' set up to track permagit/main.Your code is now permanently stored on Arweave and can be cloned by anyone using that Transaction ID.
Last updated
