Installing Git
On OS X you only need to install the latest Xcode Tools from the AppStoreOn CentOS 6 and latest Fedora Systems you would run as rootyum updateyum install gitOn Ubuntu and Debian systems you would run as root
apt-get updateapt-get install git-coreCloning the Repository
Iâm a person who likes having several copies of the Framework to work in, I tend to keep in my home folder on my boxes a folder call dev where I keep all the project repositories I use. So I recommend you start by creating the folder to host the project and its copies if you later decide to fork and work on coding inside the Framework.
mkdir -p ~/devcd ~/devOnce the folder is create you only need to clone the Git repository that is on GitHub
git clone git://github.com/rapid7/metasploit-framework.gitNow you should be able to use and work from inside the metasploit-framework folder created there. To keep you copy updated you only need to run from the folder
git pullThis will fetch the latest changes and merge them together.
Forking the Project
If you are planning on contributing to the project then it is recommended that you fork the project so you can issue pull request from GitHub. To be able to do this you must first have a GitHub account at http://github.com once you have an account there you can navigate to https://github.com/rapid7/metasploit-framework and from there click on the fork button on the page to create a fork under your account
Once it has been forked you can now clone it your development system by running the following command in your dev folder, In the example bellow you will see I amed it msf-fork so I can quickly see this is my forked copy
git clone [email protected]:<your username>/metasploit-framework.git msf-forkNext I want to be able to update from the main Framework repository so I will set the one managed by Rapid7 as upstream and test updating
git remote add upstream git://github.com/rapid7/metasploit-framework.gitgit fetch upstreamOnce you have done several commits to the clone in your machine you can push those to the fork on your GitHub account by doing running the following command
git push origin masterAny time the framework is updated and you want to merge those changes in to your forked copy you would run
git fetch upstreamgit merge upstream/masterTo send a pull request to Rapid7 so as to contribute your code or changes you would follow the GitHub guide that would do a better job than me explaining it in this blog post
http://help.github.com/send-pull-requests/
I also recommend the use of branches so you can have several branches of the fork you have so you can later merge those in to your local clone of the fork and push for latter submitting for pull requests a great guide for this is on Online Git Book http://book.git-scm.com/3_basic_branching_and_merging.html
For further reading on the use of Git I recommend
Pro Git Book (http://progit.org/book/
Git Community Book http://book.git-scm.com/index.htmlI hope you find this post useful and look forward to people contributing to the Framework.