Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GITHUB_USERNAME=fastuous
- GITLAB_USERNAME=fastuous
- GITLAB_PRIVATE_TOKEN=~/.gitlab-private-token
- # initializes git repo in current directory
- # repo gets initialized on gitlab using directory name as repo name
- gigl () {
- # if [ ! -e $$GITLAB_PRIVATE_TOKEN ]; then
- # echo "Error: No private token file found. Put your Gitlab private token into $GITLAB_PRIVATE_TOKEN"
- # return -1;
- # fi
- REPO=${PWD##*/}
- TOKEN=$(cat $GITLAB_PRIVATE_TOKEN)
- git init
- git remote add origin git@gitlab.com:$GITLAB_USERNAME/$REPO.git
- curl -H "Content-Type:application/json" https://gitlab.com/api/v3/projects\?private_token\=$TOKEN -d "{\"name\":\"$REPO\"}" | jq
- git add .
- git commit -m "Initial commit"
- git push -u origin master
- }
- # initializes git repo in current directory
- # repo gets initialized on github using directory name as repo name
- gigh () {
- REPO=${PWD##*/}
- git init
- git remote add origin git@github.com:$GITHUB_USERNAME/$REPO.git
- curl -u "$GITHUB_USERNAME" https://api.github.com/user/repos -d "{\"name\":\"$REPO\"}" | jq
- git add .
- git commit -m "Initial commit"
- git push -u origin master
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement