On this page, you'll learn how to add code to your repository. At this point, you have created a bb101repo which is a private repository that only you, the owner, can see or work in. This is not typical. Usually, you want some help on a project and you won't be the only one working in a repository. However, this is a tutorial and right now you need to learn without being distracted by other people. We'll add more people to your project later.
Important reminders about these instructions
The git commands on this page are for a GitBash terminal. However, the commands are nearly identical in a Mac OSX terminal and in an Ubuntu Linux terminal. You shouldn't have any trouble following along but if you do, please comment on the page and we'll make corrections.
This tutorial teaches you a little Git first and later a little Mercurial. All the operations that you do with Git have Mercurial equivalents and of course the reverse is also true. You are free to use Mercurial exclusively with this tutorial if you want, but you'll need to do that on your own.
Step 1. Clone your repository to your local system
Open a browser and a Git Bash window (also called a terminal window) from your desktop. The terminal window on your local system which is the system you code on as opposed to the remote Bitbucket server. After opening the terminal window, do the following:
- Navigate to your home (~) directory.
As you work with code, you will find that you have multiple repositories that you work in. It is a good idea to create a directory to contain all those repositories. Generally, this is your home directory but it can be anywhere you want it to be. Create a directory to contain your repositories.
mkdir repos
- If you haven't already done so, go to Bitbucket in your browser and log into your Bitbucket account.
- Go to your
bb101repoOverview page. - Click Clone button.
The system displays a pop-up clone dialog. By default, the clone dialog sets the protocol to HTTPS. Leave it there. - Click on the command line field that accompanies the protocol.
When you click on the command field it automatically highlights the command for you. - Copy the highlighted
gitcommand. Switch back to your terminal window.Change directory to your new
repositoriesdirectory.cd repos
Paste the command you copied from Bitbucket onto the command line and press Return.
Git will ask you for the repository password. This is the password you entered when you created your Bitbucket account. If you created an account by linking to Google or Facebook and you are following this tutorial, you should have created a password already.Windows password error
In some versions of the Microsoft Windows operating system and Git you might see an error similar
to the one in the following example.Windows clone password error exampleIf you get this error enter the following at the command line:
git config --global core.askpass
Then go back to step 4 and repeat the clone process. The bash agent should now prompt you for your password. You should only have to do this once.
Enter your password.
Git creates the repository but warns you that you have cloned an empty repository. At this point, your terminal window should look something like this:$ cd ~/repos $ git clone https://newuserme@bitbucket.org/newuserme/bb101repo.git Cloning into 'bb101repo'... Password warning: You appear to have cloned an empty repository.
You already knew that your repository was empty right? Recall that you have added no source files to it yet.
List the contents of your
reposdirectory and you should see yourbb101repodirectory in it.
Step 2. Explore your repository and fix a problem
Git said you had cloned an empty repository. This is true, your repository is empty but the directory that git created is not entirely empty. List the contents of your local repository – including the hidden files. A local repository is the copy of a repository you have on your local system. After listing the contents of your local repository, you should see something like this:
$ ls -al bb101repo/ total 0 drwxr-xr-x 3 manthony staff 102 Dec 14 10:50 . drwxr-xr-x 3 manthony staff 102 Dec 14 10:50 .. drwxr-xr-x 9 manthony staff 306 Dec 14 10:50 .git $
The .git directory contains special files and directories used by the Git system. For now, you should be aware that it is there.
Notice that Git went ahead and named your repository's directory with the same name as you did when you created it. You could have cloned the repository under a totally different name. For example, you could cloned the repository to a directory called bb101repo-practice. The advantage of this name is that it provides a clue about what you were going to do with clone. In fact, it is good not to simply use the repository name when you clone but indicate what you are doing with the clone. Why don't you fix that right now:
Remove the repository you just created.
rm -irf bb101repo/
Reissue the clone command but this time give Git a name that indicates what you are doing.
For example, you might want to call the clonebb101repo-practice:$ git clone https://newuserme@bitbucket.org/newuserme/bb101repo.git bb101repo-practice
Again, Git will tell you that you are cloning an empty repository.
List your
~/reposdirectory, you should see something similar to the following:$ ls ~/repos bb101repo-practice
Great. Now you are ready to add content to your repository.
Step 3. Create a file, add it locally, and push it to the Bitbucket Server
Bitbucket lets you set a repository's description but you may want to provide a file to get you started. The commands for this section will appear in the Command line section of the Repository setup page.
Go to your terminal window and navigate to the top level of your local repository.
cd ~/repos/bb201repo-practice/
Click the I'm starting from scratch section of the Repository setup page.
We have already completed the first portion of this process (Set up your local directory) in great detail. However these commands are available when you set up a new repository for your own use.Copy the first command line from the Create your first file, commit, and push and past into your terminal window.
echo "Daniel Stevens" >> contributors.txt
You've just created a file!
Go ahead and get the status of your local repository.
Thegit statuscommand tells you about how your project is progressing in comparison to your Bitbucket repository. You should see something like this:dstevens:teams-in-space dstevens$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: contributors.txt no changes added to commit (use "git add" and/or "git commit -a")You can see that Git is aware that you created a file in your local repository. The status output also shows you the next step, the add.
Tell git to track your new contributers.txt file using the
git addcommand.git add contributors.txt
You must perform this step before you can commit a file. What happens if you run the
statuscommand now? Git sees that you have a new file in your local repository and that you can potentially commit it.Commit all the changes you added.
Right now, the only change pending in your local repository is the new file. When you issue thecommitcommand you see this:$ git commit -m 'Initial commit with contributors' [master (root-commit) fedc3d3] Initial commit with contributors 1 file changed, 1 insertion(+) create mode 100644 contributors.txt
Up until this point, everything you have done is local – that is on your local system. It is not visible in your Bitbucket repository until you put it there with the
pushcommand. You can test this to see if it is true by opening the Bitbucketbb201repoOverview page in your browser. You should see that the Overview looks exactly as it did when you started.Go back to your local terminal window and push your committed changes using the
git pushcommand.
You should see something similar to the following:teams-in-space-repository-2 dstevens$ git push -u origin master Counting objects: 3, done. Writing objects: 100% (3/3), 253 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://dans9190@bitbucket.org/teamsinspace/teams-in-space-repository-2.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
Go to your Bitbucket bb201repo repository in your browser and click the Commits item on the menu bar.
You should see a single commit on your repository.
Bitbucket traps a lot of information with your commit and shows it to you. You can see that the Author column shows the value you used when you configured the Git global file (~/.gitconfig).- Select the Source option.
You should see that you have a single source file in your repository, the contributors.txt file you just added
Remember how the Overview page looked when you first created your repo? Take some time and explore a little. Click on buttons and travel down some links.
Next
Now, you have finished the simplest workflow between Bitbucket and a DVCS system. You created a local repository, added a new file to it, and pushed those changes to the Bitbucket repository. At this point you may have a few thoughts in your head such as:
- Hey, I don't consider a contributers.txt file to be source code.
- Aren't other people supposed to help me with my repository?
- This Git stuff is fine but I want to use Mercurial.
The next page of this tutorial will resolve some of these thoughts because you will use the fork operation and use Mercurial to add code to another user's repository.










183 Comments
Anonymous
I thoroughly enjoyed this tutorial , very well written and the instructions are easy to follow, kudos.
manthony
Thank you for this lovely comment.
Anonymous
yeah I agree with this Anon
Anonymous
And I agree with this Anon agreeing with that Anon
manthony
Anonymous
I also agree with Anon, Anon and that Anon. Oh and also the Anon below this comment.
manthony
Anonymous
Hodor?
Anonymous
I find it interesting how all these anons could be the same person which isn't me.
Anonymous
this thread is going on and anon
Anonymous
and anon and anon
Anonymous
anon anon!!
Anonymous
this is the excellent tutorial , very well written with screen shot and all instructions are easy to understand, Shakar
Thanks a lot
Anonymous
Nice work guys! Just getting started with BitBucket and my first git repository every and have been setup without any issues and I can understand what I am doing in the background!
Anonymous
I agree - this is a great tutuorial.
Do you have anything similar for SourceTree? I've read good things about and have it installed but I can't find any documenation to get me started (except the YouTube video which is more marketing focused)
Thanks!
manthony
Glad you like the tutorial. I'm sorry but we don't yet have one for Sourcetree. If you have Sourcetree open you should have the help installed. Help > Sourcetree Help that could help but not a tutorial of course.
Anonymous
Neatly explained. Thank you
Muhammad Moosa
"Excellent" comment from Excellence, for Excellent tutorial and author.
Anonymous
Its clear for all levels of Developers..

Anonymous
Very VERY helpful tutorial, great way to get started and it covers the necessary basics.
Would be nice to add also a windows version with the windows commands for people that don't know the equivalent.
manthony
Glad you found the tutorial helpful! It always makes my day to hear that.
Can you help me understand your suggestion better? The commands on this page were all executed in a GitBash terminal on a Windows 64 system. When you mean "windows version" do you mean some Windows client other than GitBash? It is perfectly possible a new one was developed that I know nothing about and I love to test new client software.
Anonymous
I would have logged in with my BitBucket account, if I could have, but I won't create another account just so I can give a tip:
You can simply hit the INSERT key in Git Bash to paste stuff. Should fit perfectly with all these no-mouse console-freaks
manthony
Thanks, I have instructions on how to do that in Step 1.10 above. It is in an expand box if the reader needs some tips. Some users need those tips others don't.
Anonymous
thank you Mary!!! Extremely helpful tutorial...
manthony
Glad to help! Have fun out there new Bitbuckian!
Anonymous
I'd have gone with "Bitbucketeer"
manthony
Trendy. I guess I'm a classicist.
Anonymous
I gotta agree with many other comments on this blog.
This is an extremely well documented tutorial. It is "deceptively" simple and elegant. These publishing qualities demand a research, empathy and planning. Well done to you all.
It's fun too!
manthony
This made my morning. Thank you for the holiday gift!
Anonymous
Wonderful tutor , Thanks
manthony
You are welcome!
Anonymous
thanks for taking the time to create this easy to follow tutorial!
manthony
You are welcome!
Anonymous
This is one of the best documentation i have ever seen in my life
manthony
I love this. Course, I'm never going to convince anyone I didn't make the comment anonymously myself.

Anonymous
I'm having trouble with the command
on Mac OSX terminal. I get the following error:
fatal: Not a git repository (or any of the parent directories): .git
manthony
You'll get this message if you issue a Git command in a file system location where you have not initialized a Git repository. Make sure change directory to a repository or a subdirectory of a repository before issuing the command.
Brian Anderson
I got a little stuck on Step 1 (10) "Paste the command you copied from Bitbucket onto the command line and press Return."
I didn't know how to paste into git bash. I tired Ctrl + V, right clicking the black area of the window, but I found I had to right click the actual window for the little menu to come up where you can select Edit and then select Paste.
Your tutorial is great, I just though mentioning something like this would help out.
manthony
Hi Brian,
Thanks for the feedback. I've tweaked that step to include a quick tip on GitBash editing. Let me know what you think.
Mary
Brian Anderson
You are awesome! Thank you so much for having this tutorial!
Anonymous
Hey, I had trouble with $ ls ~/repos
fixed that when I did
$ls ~/ repos
I couldn't sign in because I signed up with my github, what's the trick?
Anonymous
Why mine is like this below and how to fix it? I even tried to rename my file from readme.txt to just readme (as your text editor seems that saved it to readme instead of readme.txt) but no chance.
{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf510 {\fonttbl\f0\fmodern\fcharset0 Courier;} {\colortbl;\red255\green255\blue255;} \paperw11900\paperh16840\margl1440\margr1440\vieww16200\viewh13200\viewkind0 \deftab720 \pard\pardeftab720 \f0\fs24 \cf0 Welcome to My First Repo\ -------------------------------\ This repo is a practice repo I am using to learn Bitbucket.\ }manthony
Hi,
It appears you were working with Word or some other document editor. Your editor added a number of control sequences such as:
{\fonttbl\f0\fmodern\fcharset0 Courier;}You should use Notepad to edit text files. Search for code or text editor on Windows.
Mary
Anonymous
just wanted to say thanks for these great tutorials, keep up the good work!
Anonymous
I'm doing this in mercurial and am stuck on step 3.6: the "hg commit -m" command doesn't seem to work. How do I commit in mercurial?
Great tutorial up to this point!
Javed Ansari
Commit does not seems to work for me. See the below output from git bash
===================================================
jansari@IN-CGT-JANSARI ~/repos/bb101repo-practice (master)
$ git add readme
jansari@IN-CGT-JANSARI ~/repos/bb101repo-practice (master)
$ git commit -m "adding repo instructions"
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ReadMe
nothing added to commit but untracked files present (use "git add" to track)
jansari@IN-CGT-JANSARI ~/repos/bb101repo-practice (master)
$
===============================================
It is still saying that readme is a untracked file.
Anonymous
Could I suggest you add a note that Git Bash/Gui must be run with administrative rights in order to git clone to your User directory.
The error given is Permission Denied(publickey) which can be very confusing.
(At least in Windows 8)
manthony
This looks like a SSH issue not a local permissions issue. Did you choose to clone with SSH syntax instead of HTTP by chance? I'll verify. I haven't tested with Windows 8 yet.
Anonymous
Under Step 3 I am a bit confused on how to get from step 2 to 3. Once the README file is created in Notepad, how do we get it into our repository is order to list it?
manthony
You should create the file within the repository directory. In Step3.1 you change into that directory.
Anonymous
Very good indeed. Easy to follow. Thanks.
Anonymous
Very useful! Thank you so much for taking the time to write this out and add very useful images. Will refer to all of these guides as needed,
Cuitlahuac Hernandez-Santiago
Thank's for your work. For non-tech savvy people like me, in Step 3. where it says:
"2. Using your favorite editor, create a
READMEfile with the following content:"would be more comprehensible to say (or something similar):
"2. Using your favorite editor, create a
READMEfile with the following content and save the file into the folderC:\Users\your_user_name\repos\bb101repo-practice
where all this process are performed"
manthony
Cuitlahuac,
I've incorporated your suggestion into our instructions. Thank you for the suggestion!
Mary
Teresa Andel
This part is still confusing to me. I have a file created on my local workstation. I cannot find a local folder anywhere named the same as my repo (bb101repo-practice). Do I need to create this folder manually? (I thought the clone process would have put something on my machine, but I'm not finding it.
Teresa Andel
I thought I'd post an update to this, as it appears I might have reacted too early. The repos folder did actually get created in my local environment, but to a mapped (home) drive on the network. I found this by listing the files in the ~ folder in the terminal window and recognized where it was at that point. So, it is wherever your home directory is configured.
manthony
Glad you got it sorted!
Peter Le
These are some really great tutorials thanks to the good use of images. I thought I was going to get lost for a second there and I noticed a handy image sitting below the point for me to follow
Anonymous
the host is connected to the internet via proxy. when doing the same thig (git clone) from the machine in the same network - there is no problem. what am I doing wrong?
manthony
Hmm, I'm not sure what is going on here. Please file a report with support@bitbucket.org and our Support team will help you solve this.
Anonymous
Was your problem solved ?? I am also facing same problem.
Anonymous
Just pass this command
git config --global http.proxy http://10.3.100.211:8080
Anonymous
I see how to clone a git project. What if I want to grab a single file from the Downloads directory using curl or wget? The URL for a single file does not seem to be working no matter what user credentials I pass?
manthony
You can use a
curlcall to GET a single source file like this:jsolderitsch
Sorry, don't want a source file, I want a file in my Downloads directory in my private repo. The URL that the browser reports is:
https://bitbucket.org/jsolderitsch/bb101repo/downloads/SecureWebinarpdf.pdf
What is the curl command for this?
Thanks
manthony
Unfortunately, we don't have a CURL for this. I've created a ticket for this: iIssue #6915
jsolderitsch
I have some good news to report – this command works:
curl -L -O "https://bitbucket.org/jsolderitsch/bb101repo/downloads/SecureWebinar.pdf" --user jsolderitsch
BitBucket tech support suggested the -L option to curl.
manthony
Thanks! Yes, I just saw this ticket in Support. You can download with this curl call but it isn't part of our REST API. Many people want to POST files to the Downloads area and that is not supported. I'll tweak the ticket.
Ian Barton
I ran into issues while trying to clone into the newly created repo.
I'm using OAuth from Google, so I did not setup a password for my account, and I am unable to clone via the SSH or HTTPS link. I might suggest a note for those using OAuth to determine what to do for that step.
manthony
Hi Ian,
Thanks for the suggestion. I'll add a note.
Mary
Anonymous
Mr. Barton took the word right out of my... mind? I had the same problem and I agree this should be covered here.
David Murray
Mary, great tutorial and documentation! Thank you! For an application to be successful and widely adopted it is important to make entry-points available for all levels of users and knowledge levels. You are making great strides in this direction.
I have some recommendations on how to improve this portion of your documentation from my perspective based upon what I was looking for and what would have helped me:
Thank you so much and cheers! This is great stuff. If there is another tutorial that is more aligned with starting out having a project already populated (a new contributor to an existing repo, but trying to learn the basics of bb, Git, etc), please point me to it... maybe a good idea for additional documentation.
Cheers! Keep up the great work!
manthony
David,
Thank you so much for your comments and the compliments! I'll incorporate them as appropriate.
Just as an FYI, I delete the comments I incorporate to avoid confusing other readers.
Mary
David Murray
Awesome! Glad to help. Another thing you do that is excellent is that you are very active in the community and in your responses, which in-turn helps drive up the value of your docs and products.
I wondered if you had a tutorial specific to the idiosyncrasies of getting started as a new contributor to a Rails project... things like... do I still want to change the project folder name since the .rvmrc file is tied to the folder name (and therefore repo folder name)... does that make sense? I can provide a specific example if it helps.
My request is a little more in the line of specific Rails project help, but bb is a nature tie-in because that's where my repo sits.
Anyhow... any thoughts, recommendations... is this something you all would handle or find value in offering?
manthony
David,
Thank you for that comment! My goal is to be the user advocate on the ground if you will. I don't have a tutorial specific to Rails, this is the first time the topic has come up. It might be good to start with a Rails tip page in our FAQ. If you have an example or just a list of what you ran into, I can try and work one up.
Mary
Anonymous
Hello,
Thanks for this tutorial and free private repo service. I am facing clone problem. Can i discuss here? Thanks
Regards
Sohail
manthony
Sohail,
You can discuss it here. Or, you can send an email to support@bitbucket.org and get personal and often faster help.
Mary
Anonymous
Hi Mary,
Thanks for your wonderful tutorial. I am getting an error when i am trying to push the newly created REAME file to the server. Here are the commands that i typed and their output:
Please tell me what went wrong. Thanks in advance
manthony
Spencer,
The first part is Git asking you to set a configuration value for the
push.defaultvalue. The best way to set this for a Git beginner is:Once you set that, try this again:
Mary
Anonymous
Hi,
I'm having the same problem, but it does not go away even I set push default value as you told to do. It still says:
$ git push -u origin masterfatal:'origin'does not appear to be a git repositoryfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.Anonymous
Thank you Mary; these are all is so helpful!
Anonymous
Excellent tutorial, thanks for the clear explanations.
Anonymous
HI. in step two you say:
List the contents of your local repository – including the hidden files
maybe a stupid question. but how do i do that?
manthony
You can't learn unless you ask – it is a learner's question. To list the files, you use the ls command. To make sure you see hidden files, you use the -a flag. So, at the command line in GitBash you type:
ls -a
And press enter.
Anonymous
"There are a several formats"..
manthony
Dope slaps herself. Thanks for the catch!
Anonymous
This is a great tutorial. I'm a complete newbie to CVS and am so glad I found this!
I'd like to make a suggestion, though.
I got stuck on these lines:
Yes, I'm a total newbie to CVSs, and frankly don't use the command prompt enough to have known right away that "terminal window" is referring to the Git Bash command line window that was installed earlier in the tutorial. The phrase "terminal window" wasn't mentioned earlier during installation of Git Bash (at least I don't think it was).
Perhaps it would be helpful if a screenshot of the Git Bash window was added near the quoted lines.This would immediately show the reader what "terminal window" is referring to. (Or add "terminal window" to the instructions for installing Git Bash).
This is really a minor point, I know, but it did trip me up for a bit until I tried entering the instruction's commands in Git Bash.
Otherwise, awesome tutorial!!
manthony
Love this comment because it shows how even very small inconsistencies in language can cause confusion. I fight not to let them into my docs or any copy. It is really hard though to explain to non-writers why it is important without showing examples of user comments like yours. So, thank you.
I've called out terminal window in the intro sentence. Then, I'll drop in a screen cap as you request. Great comment!
Anonymous
I'm very glad I could help!
Anonymous
I'm stuck at step five. Here's my directory listing and the output of the "git status" command.
As you can see, the current directory is bb101repo-practice, so I don't understand why I'm getting that error. Does the problem have something to do with "((unknown))" after my current path?
manthony
Mark,
The problem does appear to be related to the (unknown). I had never seen this before either. So, I google for git bash unknown and found this on Stackoverflow:
http://stackoverflow.com/questions/16120078/git-bash-always-says-the-branch-is-unknown-in-all-directories
Try some of the solutions there...
Mary
Anonymous
I created a new repo using the GUI and added the readme file from there. I then opened up the Command Line Git and there was no "((unknown))" after the new repo.
I went through the commands in the SO link you provided, but nothing seemed to have any effect.
If you're Googling for answers, then I'll assume I'm on my own in finding a resolution for this. I could continue to use both the GUI and the Command Line Gits, but I wasn't able to figure out how to push the new repo and its containing file to Bitbucket from the GUI interface, so I'd have to try to figure that out on my own anyway.
Not an ideal situation in either case...
manthony
You aren't on your own. The first step should always be to google for answers. There is a wide and deep pool of technical knowledge on the net. Getting an answer there is often quickest. Googling hits our own Atlassian Answers database.
If you can't find a solution, you can file a ticket with our support@bitbucket.org. That is a good second step but may take longer as it puts you into a queue.
I'm sorry you are having problems. We will get you an answer.
Anonymous
Thanks Mary... Its really helpful to me
Anonymous
the error is caused by?
manthony
It looks like the repository URL was bad.
erer
Great tutorial, love the dumb-down language
because I can understand all this stuff, for the most part at least
.
Question though [Platform: Win8 Pro]: When I make a local copy of a repo, it gets copied here c:\Users\myuser\repos\test-repo.
Is there a way to change that folder path to anywhere else? I have a /clients folder in which I would like to copy my repos to.
Thanks in advance.
manthony
Ricardo,
When you clone a repo, it is copied into the directory where you run the command. IOW, if you want it in a different directory, change directory there and then enter the clone command. Hope that makes sense.
Mary
erer
Hello Mary,
Yes, it makes sense. However, it's not intuitive when doing it via the Git Bash window because the commands are different from the CMD/PowerShell windows (DOS based commands). At least I wasn't able to make any sense of the commands of Git Bash explained in this tutorial, and although I'm not a hard core web programmer/developer, I'm a bit familiar with the old DOS commands and that made it SO MUCH easier.
I learned this just these past couple of days.
So yes, all I have to do is navigate to the folder I want to clone the repo to in the CMD/PowerShell prompt, run the "git clone reponame" command, then password and voila, repo cloned to the folder of my preference.
Thanks for your help.
manthony
Ricardo,
Glad you solved it and thanks for the insight into your user experience. The Git Bash window does look like a DOS window but really it uses Msysgit which is explained as:
This Stackoverflow page explains what you have discovered for yourself. I'll see about explaining this a bit in the tut.
Mary
Anonymous
A comment about this: I'm pretty computer/command prompt savvy, but the ~ location tripped me up (I haven't used *nix seriously since college). A little experimenting revealed that ~ is "C:\Users\<userName>" on my Windows 7 computer. This typically isn't a folder users add files to directly. (They probably want ~/documents or some path straight off the C: drive.) A note about what ~ is in windows would be useful for newbie users.
Anonymous
This tutorial is well written. Thank you.
Anonymous
Good tutorial! Thank you.
Anonymous
Hello, very nice tutorial, it makes this all very easy. However, I have a small problem.
I don't seem to be able to fill in my password at step 1. Is this more occurent, and if so. How could I fix this?
manthony
This is not typical. Keep in mind when you type in your Password, it won't be visible to you. Can you supply any more information? What command line are you supplying? Does the command return any errors.
Anonymous
Mary, excellent work, also in replying to the comments/questions.
manthony
Hey thanks.
Anonymous
hi mary... i simply faced the same problem with anon above where i cannot write my password as im typing and it refuse to appear ? did u get it?
manthony
Hi. Your password shouldn't appear at the command line when you type. This is a security measure of most operating systems. Is it happening someplace other than the command line?
Anonymous
Check firewall
Anonymous
thank's you have saved my time gud tutorial.
Anonymous
anything without great , clear and concise documentation leads to struggle for users.
This is really well documented and awesome. Terrific job guys.
Anonymous
The tutorial explains the process of setting up a bitbucket repo beautifully.You guys at Altassian rock.
Anonymous
I have to right-click (not left click) the GIT menu bar to get the menu drop down. Windows 7 64 bit.
Roy Hornsby
Hi Mary
thanks for your great tutorial and all of your follow up comments
I was following this tut using the terminal on my Mac and when it came to submitting the password I got this: "error: git-credential-osxkeychain died of signal 11". After checking around on the forums I see this is a common error, but I've yet to find a solution that works for me. I've been playing around with SourceTree also and I get the same error there.
Do you have any suggestions how to get around this?
cheers
manthony
Roy,
To enable HTTPS Credential Caching a.k.a 'password credential caching' for https based interaction with Bitbucket, you need to download and install the "osxkeychain credential helper" and tell git to use it. We have that documentation under Stash right now and you can follow the same instructions. I'll have to update our Bitbucket docs within the next day or two.
Mary
Roy Hornsby
Hi Mary, thanks for your prompt reply.
I'm afraid that, as I'm not an experienced terminal user, the document in Stash doesn't make too much sense to me. I'll have a search around and see if I can find some step by step instructions.
cheers - roy
Anonymous
I get an error as below, when trying to clone. Wasn't able to do on IntelliJ, so tried with Cygwin with no luck:
$ git clone https://myuser@bitbucket.org/myuser/test.git
Cloning into 'test'...
error: error setting certificate verify locations:
CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none while accessing https://myuser@bitbucket.org/myuser/test.git/info/refs
fatal: HTTP request failed
manthony
This tutorial assumes you are using GitBash. I don't test against other clients. That said, I did a search for this error and found this on Stackoverflow.
Anonymous
I have substituted my user name with myuser in above comment.
Ashish Garg
I am getting an error while trying to clone from bitbucket repository via https:
Using following command:
git clone https://myuser@bitbucket.org/myrepo/myproject.git
Cloning into 'myproject'...
error: Connection time-out while accessing https://myuser@bitbucket.org/myrepo/
myproject.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Please let me know what am i doing wrong?
Thanks,
Ashish Garg
manthony
Ashish, you should send an email to support@bitbucket.org for this one.
Anonymous
how can I take a print out of this?
File>Print Preview doesn't give the printable version. Is there any printable version of this document?
Thanks
manthony
I'm attaching the PDF I get with the File > Print dialog. You don't say what browser you are using. I'm using Chrome which has a Save as PDF option. Did you want the entire documentation set or just this page?Clone Your Git Repo and Add Source Files - Bitbucket - Atlassian Documentation.pdf
Anonymous
In create README step, creating a file and saving it in repository is not mentioned properly. As I am a fresher, I found some difficulty over there. Otherwise it is really superb.
manthony
Hi, thanks for the feedback. Can you be more specific about what you had trouble with?
Anonymous
In create README part, in step no 3, you have mentioned save the README file . But you haven't mentioned how to save i.e., command to save. There I found some difficulty.
manthony
How you save would depend on what kind of client software you were using to create the file. Since, there are very many kinds of file editors, I can't be more specific; I assume you could read the documentation for your specific file editing software to learn how to Save.
Anonymous
Atlassian Team,
This is really going great - hats off to you for writing such a clear step by step user guide. I am a new comer - and only because of crystal clear guidance here, I am able to use your platform effectively.
I will be selfish if I don't mention this wonderful Tutorial by Lars Vogel which really cleared the concepts about DVCS in astonishingly simple language - thanks to him as well.
I have few suggestions - hope you will consider.
Thanks once again for a wonderful product, platform and best of all, Documentation.
Best Regards,
AAD
manthony
Glad to hear you like our tutorial and our product. Lars' tutorial on DVCS is very well done. We mention it to our users who are unfamiliar with DVCS. Regarding your suggestions:
Thanks again for taking the time to comment. We really appreciate our active community.
Anonymous
Thanks for your reply.
>>Currently, we don't have plans to change the tutorial to use Sourcetree exclusively. Mostly because the rest of the documentation assumes you are using a command-line. I'll bring it up with the team.
I understand - this is a huge task. But at least you can mention somewhere in 'BitBucket 101' that such a GUI tool is available. I started searching for GUI tool after seeing the terminal screen in your first tutorial
>>I'm not sure if we have plans to support SVN with Sourctree. I'll ask and reply here.
Did I fail to convey my point ? I did not expect SourceTree to support SVN. But I wished if SourceTree can have Shell Extensions SIMILAR TO SVN - so that most of the job can be done even without opening SourceTree. Of course I am not sure if SourceTree Developers would like this idea AFTER developing a nice GUI.
Best Regards,
AAD
Anonymous
>>I understand - this is a huge task. But at least you can mention somewhere in 'BitBucket 101' that such a GUI tool is available. I started searching for GUI tool after seeing the terminal screen in your first tutorial
Please ignore. I can see that it already existed in your 101. Sorry for inconvenience.
Regards,
AAD
Anonymous
Clear, concise tutorial.
Anonymous
Awesome tutorial, straight-forward! Thanks!
Anonymous
I have created local directory repos and when I tried to see in my file system...it is showing me the repos is created in h drive (network drive). When I do pwd in GIt bash it is showing me as /h
Is this expected behavior. Is my local repository in the network drive not in the c drive?
manthony
You can put GitBash or your repos in any drive accessible to you. The C is the standard drive for most setups so that is what we show in our examples.
Anonymous
I did not do any changes in my installation or setup. I expected GitBash will create repos directory in my c drive...but it created in network drive. I never accessed this h drive(network drive) earlier in my daily work.
manthony
It is possible for your Windows administrator to specify a default directory for installing new Windows programs. That might be the situation in your case. If you are concerned, you can talk to your system administrator about this.
Anonymous
I get an error as below, when trying to clone. why and how to solve
Administrator@20130814-2319 /c/repos $ git clone git@bitbucket.org:Edward_Wu/bb101repo.git
Cloning into 'bb101repo'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Thanks,
manthony
Your clone should use an http URL at this point. It would look like this:
If you want to skip ahead and use SSH, you can but make sure you have set up your SSH key and imported it into Bitbucket.
Anonymous
I had the same problem. I verified the address as Edward_Wu suggested, but still did not have any luck.
It turned out that I had created a public key back on my first attempt to go through the tutorials. I went in and deleted that key since I no longer use that computer. I went back to the "Clone" button and re-copied the URL. It worked that time.
Ryan Clamp
I've been having many problems with this unfortunately, on my home computer it works fine however at work I'm having problems.
When trying to clone I get the following:
fatal: unable to access 'https://reponame@bitbucket.org/reponame/lwqa.gi
t/': Failed connect to bitbucket.org:443; No error
I'm not behind a proxy/blocked firewall and can access HTTPS sites normally.
manthony
The call was attempting to connect through port 443 but failed. It could be the port is blocked for some reason. Did you talk to your system administrator? You can also try SSH access to see if that helps. If you try both of those solutions and still have problems, file a support ticket.
Anonymous
Just wanted to post that these directions are phenomenal. I'm a sysadmin who'd learning a bit of coding/version management/etc. This is incredibly helpful and I'm looking forward to utilizing the heck out of git/bitbucket.
manthony
Hey thanks! You made my day.
Anonymous
Hi,
Thank you for posting this nice tutorial. When I tried to push the commits I got the below error:
$ git push -u master
warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'upstream'. To squelch this message and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default upstream
See 'git help config' and search for 'push.default' for further information.
fatal: 'master' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
so I issued the below command
git config --global push.default upstream
but now I am receving the following message
$ git push -u master
fatal: 'master' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
What did I miss?
Anonymous
gosh! its embarrassing
the correct command is
just noticed after posting the above comment, sorry!
Anonymous
Hi, Is there a way I can write a dos script to pull my "Bit bucket Branch" into my local machine. I need to automate a script which will pull on daily basis before I start writing in my branch.
manthony
Yes, you can write a batch file that does this for you. Then, use the Windows scheduler to run the batch file regularly. Stack Overflow has a lot of queries about this:
http://stackoverflow.com/questions/5401229/how-do-i-execute-several-git-commands-in-a-batch-file-without-terminating-after
Anonymous
You need to explain what you are doing when you "clone" your repository to the local system and how this relates to checking out a local copy of the repositlyr (for those familiar with other version control software). Is it the same thing?
manthony
Cloning is not the same as a "check out" in other version control software. With Git you are always cloning the entire repository. With other version control systems, you can checkout just a single directory.
This documentation does not compare and contrast version control systems. Lots of folks have already done this. Often, very heated and "religious" discussions spring up. Since the goal of this documentation is to teach you about Bitbucket and many of our readers already know DVCS, I don't do a lot of compare and contrast here.
Anonymous
I do not understand where I am supposed to save the readme file in the tutorial!
manthony
You should save it to the root folder of your local tutorial directory.
Anonymous
Hi, everybody. I've some problem like this:
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://nurdus@bitbucket.org/nurdusteam_eties/lux.git/info/refs
fatal: HTTP request failed
What do you think about it?
Best regard!
manthony
You don't mention which client you are using. You need to set a flag with Git here:
https://bitbucket.org/site/master/issue/5292/ssl3_get_server_certificate
http://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall/8467406#8467406
Anonymous
Doesn't let me type on the password bit :/
manthony
Really? What step were you on?
Anonymous
manthony, thanks. I'll try to do.
Anonymous
I did it thank you very mush (Y)
Jeff Clark
I'm getting stuck on the clone step. I'm getting the following:
$ git clone https://<my info>
Cloning into 'bb101repo'...
fatal: could not read Password for 'https://<my info>@bitbucket.org': No such file or directory
Any ideas on what the problem could be? I just opened my account today.
Dan Stevens [Atlassian]
A few things to try:
mkdir reposcommand again.cd reposbefore you paste the clone command.If none of those things work try contacting support@bitbucket.org to see if they can help you resolve the problem.
Mike P. O'Keeffe
Thanks for the tutorial, I'm finding it very useful. I've had a few issues, but a quick search sorts that. Will post anything I find that may help.
Just as a help to anyone else having trouble trying to clone into their repo folder, I found that you have to edit the command to include your password as follows:
git clone https://username@bitbucket.org/username/bb101repo.git
has to be changed to
git clone https://username:password@bitbucket.org/username/bb101repo.git
I kept getting the following command, not sure what the reason was, but adding the password fixes it.
fatal: could not read Password for 'https://mikepokeeffe@bitbucket.org': No such
file or directory
Anonymous
Thank you! This worked.
Danny Blood
I too had the same problem and adding the password into the url, as Mike suggests, solved the problem.
I'm curious why this is the case though. Why didn't it prompt for the password as the documentation suggests?
Anonymous
Thank you! this worked perfect!
muhammad zaki
ohsem
Anonymous
Great tutorial! Thanks very much.
But my first "git push" failed and I had to submit git config --global push.default simple first. (Or should I have used "... default upstream" instead?
Then I got this error: "error: src refspec master does not match any."
I found this solution on stackoverflow:use this one-off command: git commit -m 'initial commit'.
Maybe this is all because of recent updates in git?
Dan Stevens [Atlassian]
Thank you! I am going to look into adding this step to the tutorial as I see others have experienced the same challenge.
Anonymous
Hello! I`ve bumped into a problem while trying to clone repository to my local drive (end of step 1), after I send a command to clone, instead of password prompt I got an error, here is gitBash log:
Lena@ORBRY /d/Alex$ mkdir bb_reposLena@ORBRY /d/Alex$ cd bb_repos/Lena@ORBRY /d/Alex/bb_repos$ git clone https://Orbry@bitbucket.org/Orbry/bb101repo.gitCloning into 'bb101repo'...fatal: could not read Password for 'https://Orbry@bitbucket.org': No such file or directorySo far I`ve completed all the steps, confirmed email, and everything was fine. What could be the cause of the problem?
Anonymous
The problem is solved, you have to supply a password initially:
and if you have some special symbols in username or password, you have to URL encode them
Dan Stevens [Atlassian]
Thank you for taking the time to comment. I'm glad you found a solution to the error message. I'm going to be going back through this portion of the tutorial and making some updates as I see you are not the first to experience this issue.
Anonymous
60 mins for walking the tutorial? - never!
after 15 mins, i was almost done with the git part, but failed (while following the instructions).
Then i needed to search and try... until i found [this].
Took me an hour just to complete the first half...
What a time waste having to run after a solution instead of grasping the whole picture.
One unhappy customer.
And while we're at it: is it correct, the whatever i develop using bitbucket "belongs" to atlassian? I've had that in the past (people stealing my code/effort/ideas). The terms of service seam to be biased towards one company (if i understand them correctly... not a native...)
Well, so better stop wasting resources NOW, when it wont hurt too much yet.
Bye
Dan Stevens [Atlassian]
Hello I'm sorry you had a disappointing experience with the tutorial. We are always working to improve it, it is currently designed to go through the complete process of setting up git, a repository on your local system, configuring your git set up, and cloning the repository all using the command line interface. This takes time and effort but it's the most complete way to establish a git presence which you can later modify and use in any way you choose.
Soon we will be putting together a tutorial which follows the "fast path" to getting git set up and running using our SourceTree GUI.
viswanadh bhaskarla
when i have done with creating my repository and created a directory in my system...i have executed the command...
git clone https://xyz@bitbucket.org/xyz05/xyz101repo.git
cloning into xyz101repo
fatal : could not read password for the 'link' :No such file or directory
what to do now..? how to resolve this one ..? can annyone suggest me
viswanadh bhaskarla
I have tried some few solutions from above....comments...but i failed in dat tooo....it is shwoing..authentication failed for the url
Anonymous
Hello everybody,
I'm following the tutorial and I'm struck in the step referred to cloning the empty repo, it just doesn't ask me for the password and directly get the following error: "fatal: could not read Password for..."
Could you give me hand??
Thanks!
Anonymous
Having the same problem..
Fabiola De la Cueva
Mary,
Excellent tutorial. Would it be possible to do a tutorial using TortoiseGit or a Windows integrated tool. I found your tutorial for the Mercurial part a lot easier to follow and I believe it is the TortoiseHg that made it easier.
Thanks again for putting the time and effort to help us get started.
Regards,
Fab
Dan Stevens [Atlassian]
Glad you enjoyed the tutorial! I am the new writer for these documents and am in the early stages of creating a branch of this tutorial which would be based on SourceTree (Atlassian's GUI based Git Source control) and Git in both Windows and Mac.
I hope I can continue to keep this tutorial in the awesome shape in which Mary left it to me.
Anonymous
Hi, despite a couple of false starts, I got everything in this tutorial done. But say I want to change my readme file. I edited it. I thought should be able to say
git commit -m "change to readme"
then
git push -u origin master
to see the change in bitbucket. But I had to re-add the file first. So do I have to enter three commands every time I change a file: add, push, commit?
BTW, when I read things like "Go back ... and push your committed changes using the
git pushcommand" I immediately enter "git push" right then without waiting to read further, then I see that there is more to the command. Maybe there is a better wording, such as leaving the git out of it, that forces me to keep reading.Christy
The clone url I copy from the Bitbucket dashboard is not a git one (hg clone https://me@bitbucket.org/me/reponame), but I have seen other comments saying to modify it.
Trying what I think makes sense doesn't work:
$ git clone https://me@bitbucket.org/me/reponame
Cloning into 'reponame'...
fatal: repository 'https://me@bitbucket.org/me/reponame/' not found
$ git clone https://me@bitbucket.org/me/reponame.git
Cloning into 'reponame'...
fatal: repository 'https://me@bitbucket.org/me/reponame.git not found
I've tried ssh (uploaded my public key), and http.
What am I missing? I use git every day, so I feel pretty silly about now.
Christy
Ok, new to mercurial. I had forked a mercurial repository, and that's why the git command wasn't working. Silly, indeed.
Dan Stevens [Atlassian]
Hey Christy,
Sorry I didn't get to your question yesterday. I did the same thing about a week ago and I wrote this tutorial
.
Happy coding,
Dan