Saturday, February 25, 2012

How I use bitbucket

How I started using bitbucket. I got all the help from the bitbucket (bitbucket 101). So you will get all these and more there.

I had a bunch of scripts on my computer. These scripts are organized in different folders each for a project.

do a

#> cd path/to/folder
#> git init
#> git add .
#> git -a -m "Initial commit"

in each folder

optional

#> git config --global user.name "FIRST_NAME LAST_NAME"
#> git config --global user.email "MY_NAME@example.com"

This creates a git repository in each of these folders.

Now create a account in bitbucket.org. Add a repository for each project you want to upload.

Now to go back to each of the folders in the local machine and issue the following:

#> cd /path/to/my/repo
#> git clone https://MY_USER@bitbucket.org/MY_USER/MY_REPO-git.git
#> git push -u origin master


Later on if you want to add more files to the repo,


#> cd /path/to/my/repo
#> git add NEW_FILENAME
#> git commit -m "NEW_FILENAME ADDED"
#> git push -u origin master # to push changes for the first time


No comments:

Post a Comment