Sunday, January 5, 2014

Git How to

Some git commands that provide the basics for working with a git repository

Add git origin


git remote add origin https://username:password@bitbucket.org/[user]/gitrepo.git

Change git url once you add a git origin


git remote set-url origin https://username:password@bitbucket.org/[user]/gitrepo.git

Add files


git add filename

Commit


git commit -a

Push latest code to repository for master branch


git push origin master

Clone a repository

git clone https://haighis@bitbucket.org/haighis/urlwordcountersample.git