Monday, November 25, 2013

Push up an existing repository [bitbucket.org]

You already have a Git repository on your computer. Let's push it up to Bitbucket.
cd /path/to/my/repo
git remote add origin https://username@bitbucket.org/username/test.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push -u origin --tags # pushes up any tags
[source]

Simple linux bash script to commit and push git updates

This assumes you have setup the git on dev directory (replace as needed), it was fairly simple thanks to bitbucket instructions

Here is the code:
#!/bin/bash
cd /var/www/vhosts/dev
echo "Please enter commit comment: "
read input_variable
git commit -am "$input_variable"
git push -u origin master

Let me know if you have question, comments, etc