using bitbucket and mercurial
TRANSCRIPT
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.
Log in as gramenerClick on the “Log in” link at the top to log in.
The username is “gramener”.
The password can be obtained from [email protected]
Start a project
If you’re starting a new project, click on the “create repository” link on the top right.
Fill in the details
Type a project NameSelect PrivateChoose MercurialSelect Issue trackingSelect WikiChoose LanguageType a Description
Optionally, add a Website
Visit the site
The repository is now created.
It can be accessed at https://bitbucket.org/gramener/<name>
Currently, it contains no data
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.
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.
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.
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.
Changes pushed
After hg push, you will be able to see your files on bitbucket.org
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.
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.)
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
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.
View differences
On bitbucket, you can browse and see the exact lines that were changed in every commit.