git
server with GitLab sync
The project was aimed to enable users to have their remote servers (which have required tools, compilers, run environments etc.) act as a git repository server.
The idea behind this is that you can develop your projects on your local system (maybe because you have good local development tools which cannot run on server or just because of the lag (*-`ω´- )人 ), as always do git push and have a git copy of your project.
But it is always annoying to do git pull at the server end and then run/compile/execute your code right?
This project aims to solve that
This repository contains scripts (for linux, not Windows, maybe Mac, but mainly linux (。・ω・)ノ゙) that let your server act like a git remote. So, on your local system, you just clone the repo (remember to have been connected to VPN before doing this), make changes, do git push
and viola, the server has your latest code (with latest commits) + it is also synced to your gitlab/github account.
How To Use
Things required
-
Have a GitLab or a GitHub repo where you'd want your server repo to be kept as a backup.
-
SSH setup on your git account. See these:
- GitLab - Generating SSH Keys and Adding SSH Keys to your Account
- GitHub - Generating SSH Keys and Adding SSH Keys to your Account
Setup and Run
-
Clone this repo using:
git clone https://gitlab.vayavyalabs.com:8000/darshan-personal/git-server-with-gitlab-sync.git
-
Create a new repo and copy the ssh link (example: git@gitlab.vayavyalabs.com:darshan-personal/git-server-with-gitlab-sync.git)
-
Add the link in the repo_link.d file.
-
Add your work dir (from where you build, test, execute your code) in the workdir.d file
-
Run the setup.sh script by using the commands:
chmod +x setup.sh && ./setup.sh
-
The script will run, make necessary changes and present an URL that you can use on your local system (VPN Needed). Follow instructions printed on the screen
-
The link is stored in the gitlink.d file in your home directory
-
Copy the autopush.sh script to your local system. You can run this script to automatically push the repo (without needing to add and commit) to the server.
Whenever you run the autopush.sh
script, it will also trigger a script that will push your repo to a git server online