MPIR switch to using Git

20 views
Skip to first unread message

Bill Hart

unread,
Nov 25, 2012, 4:25:12 PM11/25/12
to mpir-devel
Hi all,

I have just finished creating a Git repository for MPIR on GitHub:

https://github.com/wbhart/mpir

We will be using Git very much like SVN, to simplify things for SVN
users until they get used to the more advanced features of Git, with
my GitHub page acting as the main development repository.

Here are the steps that developers need to undertake if they plan to
use the Git repository for development:

* Create your own personal GitHub account (free) on http://github.com/
if you do not have one. (Click the "Sign Up For Free" button at the
upper right, and follow the instructions.)

* Fork my copy of the MPIR repository by going to
https://github.com/wbhart/mpir and click the "Fork" button in the
upper right.

* If you plan to use Git For Windows:

----- install it by going to http://windows.github.com/ and clicking
the Download button in the upper right, run it, following the
instructions.

----- clone your *own* MPIR GitHub repo in Windows, e.g. go to
https://gihub.com/yourusername/mpir and click "Clone in Windows" near
the top of the page on the left.

----- follow the Git For Windows instructions to add my repo
(https://github.com/wbhart/mpir) as a "remote". Give it the name bill
or something, which is easier to remember.

* If you plan to use *nix git:

------ git clone https://gihub.com/yourusername/mpir mpir

------ cd mpir; git remote add https://github.com/wbhart/mpir bill

The second last step in each case is equivalent to the svn checkout
procedure and creates a copy of the repository on your local machine
in the mpir directory. The last step just connects it up to the main
repo (mine).

You are now ready to begin contributing to MPIR using Git.

The four main differences between SVN and Git that you have to
remember are the following:

* trunk in svn is called master in git. Most developers will work in
master. (Branches are possible just like svn, but you'll need to learn
more about git to do that.)

* after doing git commit (similar to svn commit) there is an extra
step required to make your commits public, namely: git push. This
pushes all your changes to the public repo. You can make as many
commits as you like before you make them public with git push. Unlike
svn commit, git commit only makes commits to your local repo, not to
the public one. The extra step, git push, takes them all the way to
the public repo.

* To keep up-to-date with the main development repo, you have to,
every now and again do: git pull bill (this is the equivalent of svn
up)

* Other users do not automatically get your changes unless I merge
them into the main repo. For that, you have to tell me when you have
pushed changes to your public repo. (Users can pull directly from one
another, but you need to learn more about git to do that.)

Enjoy!

Bill.

Bill Hart

unread,
Nov 25, 2012, 5:21:05 PM11/25/12
to mpir-devel
There's a correction to the above for Windows. I reproduce the steps
below with the correction for convenience:

* Create your own personal GitHub account (free) on http://github.com/
if you do not have one. (Click the "Sign Up For Free" button at the
upper right, and follow the instructions.)

* Fork my copy of the MPIR repository by going to
https://github.com/wbhart/mpir and click the "Fork" button in the
upper right.

* If you plan to use Git For Windows:

----- install it by going to http://windows.github.com/ and clicking
the Download button in the upper right, run it, following the
instructions.

----- clone your MPIR GitHub repo in Windows, i.e. in GitHub
For Windows sign in to GitHub and click on your GitHub repo and
click the "->clone" button. This clones it to your local machine. To
see the actual files, go to "Tools" in the upper right and click "Open
in Explorer"

----- add my repo (https://github.com/wbhart/mpir) as a "remote". To
do this, go to your local repo in GitHub For Windows and go to "Tools"
and then "Open a shell here" and type:
git remote add https://github.com/wbhart/mpir bill

* If you plan to use *nix git:

------ git clone https://gihub.com/yourusername/mpir mpir

------ cd mpir; git remote add https://github.com/wbhart/mpir bill

The second last step in each case is equivalent to the svn checkout
procedure and creates a copy of the repository on your local machine
in the mpir directory. The last step just connects it up to the main
repo (mine).

You are now ready to begin contributing to MPIR using Git.

The four main differences between SVN and Git that you have to
remember are the following:

* trunk in svn is called master in git. Most developers will work in
master. (Branches are possible just like svn, but you'll need to learn
more about git to do that.)

* after doing git commit (similar to svn commit) there is an extra
step required to make your commits public, namely: git push. This
pushes all your changes to the public repo. You can make as many
commits as you like before you make them public with git push. Unlike
svn commit, git commit only makes commits to your local repo, not to
the public one. The extra step, git push, takes them all the way to
the public repo.

* To keep up-to-date with the main development repo, you have to,
every now and again do: git pull bill (this is the equivalent of svn
up). To do this in GitHub For Windows, go to your local repo in
and go to "Tools" and then "Open a shell here" and type:
git pull bill

* Other users do not automatically get your changes unless I merge
them into the main repo. For that, you have to tell me when you have
pushed changes to your public repo. (Users can pull directly from one
another, but you need to learn more about git to do that.)

Bill.

Bill Hart

unread,
Nov 25, 2012, 5:23:55 PM11/25/12
to mpir-devel
One additional note:

for GitHub for Windows, you push to the public repo by clicking
"Sync". All commits to your local repo are then pushed out to the
public repo.

Bill.

Cactus

unread,
Nov 25, 2012, 5:56:53 PM11/25/12
to mpir-...@googlegroups.com, goodwi...@googlemail.com
I now have my GIT repository (https://github.com/BrianGladman/mpir) for MPIR up at GITHUB and I have added the build files for Visual Studio 2012.

     Brian

Bill Hart

unread,
Nov 25, 2012, 6:07:10 PM11/25/12
to Cactus, mpir-...@googlegroups.com
Hi Brian,

great! I've merged this to my repo.

By the way, an additional correction to my instructions:

git remote add https://github.com/wbhart/mpir bill

should be

git remote add bill https://github.com/wbhart/mpir

apparently.

Once you have done this, you should be able to get up-to-date with me
by doing git pull bill

I have just made some changes for you to try this on.

It's unfortunate that Git For Windows doesn't have a button for doing
git pull bill and you have to do it from the command line. I guess
they'll eventually add a button for this.

Bill.

Bill Hart

unread,
Nov 25, 2012, 6:11:07 PM11/25/12
to Cactus, mpir-...@googlegroups.com
If it complains, try

git pull bill master

My instructions contained quite a few errors it seems. Sorry about that.

Bill.

Bill Hart

unread,
Nov 25, 2012, 6:24:06 PM11/25/12
to Brian Gladman, Cactus, mpir-...@googlegroups.com
No problem at all. Whatever works best for you. It all seems to have
worked fine, which is great!

Good riddance to svn. :-)

Bill

On 25 November 2012 22:20, Brian Gladman <b...@gladman.plus.com> wrote:
> On 25/11/2012 23:07, Bill Hart wrote:
>> Hi Brian,
>>
>> great! I've merged this to my repo.
>>
>> By the way, an additional correction to my instructions:
>>
>> git remote add https://github.com/wbhart/mpir bill
>>
>> should be
>>
>> git remote add bill https://github.com/wbhart/mpir
>>
>> apparently.
>>
>> Once you have done this, you should be able to get up-to-date with me
>> by doing git pull bill
>>
>> I have just made some changes for you to try this on.
>>
>> It's unfortunate that Git For Windows doesn't have a button for doing
>> git pull bill and you have to do it from the command line. I guess
>> they'll eventually add a button for this.
>
> I use GIT rather than GITHUB as it has a more complete command set on
> the Windows context menus. The pull command is available on this menu
> and it pulled your changes without any problems (AFAIK).

Brian Gladman

unread,
Nov 25, 2012, 5:20:56 PM11/25/12
to Bill Hart, Cactus, mpir-...@googlegroups.com
On 25/11/2012 23:07, Bill Hart wrote:
> Hi Brian,
>
> great! I've merged this to my repo.
>
> By the way, an additional correction to my instructions:
>
> git remote add https://github.com/wbhart/mpir bill
>
> should be
>
> git remote add bill https://github.com/wbhart/mpir
>
> apparently.
>
> Once you have done this, you should be able to get up-to-date with me
> by doing git pull bill
>
> I have just made some changes for you to try this on.
>
> It's unfortunate that Git For Windows doesn't have a button for doing
> git pull bill and you have to do it from the command line. I guess
> they'll eventually add a button for this.

I use GIT rather than GITHUB as it has a more complete command set on
the Windows context menus. The pull command is available on this menu
and it pulled your changes without any problems (AFAIK).




>
Reply all
Reply to author
Forward
0 new messages