BitBucket Tutorial


Set up Source Tree

  1. Security Key Set Up
    A. Source Tree Side:
    Tools -> Create or Import SSH Keys -> Generate (PuTTY Key Generator) -> Copy the generated public key -> (Goto 1.B.a) ->(1.A.a) Save Public key  and Save Private Key (to a local folder)
    Tools -> Launch SSH Agent (Pageant) -> Add Key (Pageant Key List window) -> Load the saved private key (for listening SSH events)
    B. Web Side: [User icon] -> Manage Account  Bitbucket settings -> SSH Keys -> Add Key -> (1.B.a) Paste the public key and give it a Label as the name -> Add Key ->(Goto 1.A.a)
  2. Create a repository
    A. Web Side: create -> Under “Clone your new repo” copy the origin address something like “ssh://[RepoName].git” -> (Goto 2.B.a)B. Source Tree Side: (2.B.a) Clone/New Icon -> Paste Source Path/URL -> Set up Destination Path -> Clone (.git folder will be created in the destination folder)
  3. Add, Submit, and Push Changes to the source
    A. Source Tree Side:
    Any modified or new files will show up in the “Working Copy Changes” -> Select all changes -> Add -> Commit-> write commit message -> Commit -> Push -> select branch
    We can also create New Branch and push it to the source, or create new Label (mile stone) and push it to the source.
  4. check file status, ignored files, if sourcetree is not tracking the changes you just made.


Console interface (MINGW32):

$ cd c:/workspace
$ ls
$ cd [RepoFolder]
$ ls
$ vi file.txt #edit a file
$ git add .
$ git status
$ touch file2.txt #create a new file
$ git add .
$ git status
$ git add -u
$ git status
$ git commit -m “This is a update”
$ git push origin [BranchName]
$ git branch master #may fail
$ git checkout master #current branch name is “master”
$ git push origin master #current branch name is “master”

$ git status –ignored
On branch master
Your branch is up-to-date with ‘origin/master’.
Ignored files:
(use “git add -f <file>…” to include in what will be committed)


nothing to commit, working directory clean

$ git add *
The following paths are ignored by one of your .gitignore files:
Use -f if you really want to add them.

$ git add -f *
How to do it recursively?



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s