Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When using Mercurial HG, how to just get the latest code?

Tags:

I am new to Mercurial HG. My friends created a repo and I am going to use it. I installed TortoiseHG and trying to get the latest code. I found that when using Clone operation, it will pull all code to my local, including the histories (Am I right?). This is not needed for me. I just wanna get the latest code. Is there an operation for this?

like image 744
DeepNightTwo Avatar asked Nov 17 '10 14:11

DeepNightTwo


People also ask

How do you update hg?

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed. When all heads of a branch are closed, the branch will be considered closed.

How do I know my Mercurial version?

If you already have Mercurial installed, make sure you have version 1.7 or later. To check, enter hg --version at the command line.

How does Mercurial help in source code control?

Mercurial is a free, distributed version control system. It's also referred to as a revision control system or Mercurial source control. It is used by software development teams to manage and track changes across projects.


1 Answers

In short, no.

In a bit longer: Mercurial doesn't yet support “shallow” clones where you only get part of the history. So each time you clone you pull in the entire repository with all changesets.

Additionally, unlike Subversion, there is no way to make a “narrow” clone where you only checkout a portion of a repository. For example, if a repository has directories foo/ and bar/, there is no way to get only the bar/ directory. In other words, Mercurial always operates on project-wide snapshots.

like image 97
David Wolever Avatar answered Oct 26 '22 19:10

David Wolever