Go to your repository and click " I'm starting from scratch ". Your will see some code, and you will also see your repository URL. My repository URL is https://firstname.lastname@example.org/aj3sh/myrepository.git
Now let's create example project. Create three text files with different names ( eg 1.txt, 2.txt, 3.txt ) and different contents. Right click to the folder and click "Git Bash here" as shown in the image below. Your will see the git prompt.
Now to upload our files to repository follow the code.
- Setting my account
$ git config --global user.email "email@example.com" You can find your email in your repository URL :
- Initializing git to the directory or creating local repository
$ git init
Initialized empty Git repository in C:/Users/aj3ss/Desktop/myproject/.git/
- Adding files to local repository
$ git add .
- Committing for adding files
$ git commit -m "First Update"
[master (root-commit) 6b5deff] First Update
3 files changed, 3 insertions(+)
create mode 100644 1.txt
create mode 100644 2.txt
create mode 100644 3..txt
- Adding remote git repository to upload as name origin
$ git remote add origin https://firstname.lastname@example.org/aj3sh/myrepository.git
- Pushing files from local repository to remote repository
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (5/5), 296 bytes | 74.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
* [new branch] master -> master
Now click on source of your repository in your Bitbucket. You will see your files have been uploaded with the message First update