Axa Assurance Maroc - Insurer Innovation Award 2024
Using Bitbucket and Mercurial
1. Visit Bitbucket.org
Bitbucket.org can host
code repositories.
Public repositories are
free. Private
repositories are free if
sharing with up to 5
people.
Bitbucket uses
Mercurial (hg) as well
as git for version
control.
We will use Mercurial.
2. Log in as
gramener
Click on the “Log in”
link at the top to log in.
The username is
“gramener”.
The password can be
obtained from
s.anand@gramener.com
3. Start a project
If you’re starting a new
project, click on the
“create repository” link
on the top right.
4. Fill in the details
Type a project Name
Select Private
Choose Mercurial
Select Issue tracking
Select Wiki
Choose Language
Type a Description
Optionally, add a
Website
5. Visit the site
The repository is now
created.
It can be accessed at
https://bitbucket.org
/gramener/<name>
Currently, it contains
no data
6. Clone a project
First, install cygwin
with Mercural (hg)
selected.
Clone an existing or
newly created project
by typing on the
command prompt:
hg clone <project-url>
This may ask you for
your ID (gramener) and
your password.
7. Add files
Create or copy the
project files into the
cloned repository.
Here, I am copying files
I already created into
the repository.
You may use Windows
Explorer to copy, or
Notepad++ to create.
Any other tool is fine
as well.
8. Commit changes
hg status tells you the
status of each file.
Now, nothing’s
tracked.
hg add file tells hg you
want to commit file. It
has not yet committed
hg commit commits
only added files into
the local repository.
Bitbucket still doesn’t
know of this yet.
9. Push changes
hg push tells hg to
send the changes to
bitbucket.
Only at this point will
others be able to see
your change.
This means that you
can commit changes
offline, locally, and
push all your local
commits when you go
online.
11. Email notification
You can receive a mail
when someone
commits a change.
In Admin, click on
Services, and choose
Email.
Type in your email ID
and Save settings.
12. Ignore files
If you want to ignore
specific files, create a
.hgignore file.
Type in a list of regular
expressions matching
the files to ignore.
abc$ matches all files
ending with abc. ($
stands for the end.)
13. Pull changes first
Before committing
files, first pull other
people’s changes into
your repository.
ALWAYS.
hg pull copies them
from bitbucket to the
local repository.
hg update copies from
local repository to your
folder.
YOU MUST RUN BOTH
14. Add / change files
hg add any new files to
the repository.
hg commit any existing
or newly added files to
the local repository.
Make sure you type a
descriptive message
with –m"…"
hg push committed
changes to bitbucket.