On 09/02/2016 09:49 AM, Martin Baker wrote:
> I get the impression that rebase works relative to my local master and
> not trunk. So if I were to use rebase as you suggest I would want my
> local master to track trunk?

You can for example look at this tutorial.
https://www.atlassian.com/git/tutorials/rewriting-history/
There are even more out there, just search for "git rebase tutorial".

You have to let go the SVN mindset. With git nearly *everything* is
local. So what is called "master" in your repository, is *your* master.
It does not have to do with the svn trunk or the master of
https://github.com/fricas/fricas . OK, that's only half-right, because
one can, of course, decide that it always agrees with the upstream
master. But that is *your* decision. Git does not enforce it. The
upstream master is recorded by git as "upstream/master" (not just
"master"). And when I write "upstream" above, it has to do with how you
actually called your remote.

On
https://sites.google.com/site/hemmecke/fricas-svn#how-to-work-with
I suggest via

git remote add upstream https://github.com/fricas/fricas.git

to use "upstream" as the name of the "official fricas git repository",
but if you used

git remote add myfoo https://github.com/fricas/fricas.git

then the master of https://github.com/fricas/fricas.git shows up in your
local repository as "myfoo/master". So let's keep "upstream" as the name
for the remote.

> martin@linux-rks1:~/fricas> git rebase
> First, rewinding head to replay your work on top of it...
> Fast-forwarded master to refs/remotes/origin/master.

Yes, this does not work, because if you have setup your local repo as
described on https://sites.google.com/site/hemmecke/fricas-svn, then
"origin" is the name of the remote that points to

https://github.com/martinbaker/fricas

You can see the remotes and where they point to via

git remote -v

In my case it looks like

baker   git://github.com/martinbaker/fricas.git (fetch)
baker   git://github.com/martinbaker/fricas.git (push)
fricas-gh       github-fricas:fricas/fricas.git (fetch)
fricas-gh       github-fricas:fricas/fricas.git (push)
origin  github:hemmecke/fricas.git (fetch)
origin  github:hemmecke/fricas.git (push)
upstream        https://github.com/fricas/fricas.git (fetch)
upstream        https://github.com/fricas/fricas.git (push)

And if you wonder why my origin has just "github" in front of the colon,
then that's because in my ~/.ssh/config I have the following lines

=============================
Host github
  IdentityFile ~/.ssh/github
  HostName github.com
  User git
=============================

that tell git (actually the underlying ssh) which ssh-key to take when
talking to github.com.

Just using

  git rebase

is not enough

even if you say

  git rebase master

that doesn't do anything when your checked out branch is master, because
it means to put everything from master on top of master (i.e. nothing).

Suppose you have checked out your development branch.
You would have to say something like

  git fetch upstream # in order to get the latest stuff
  git rebase upstream/master

I hope you have a good tool installed in case that there are merge
conflicts. I have installed kdiff3 and did

  git config --global merge.tool=kdiff3

to let git know about it. So that whenever there is a merge conflict, I
simply call

  git mergetool

and kdiff3 will pop up and help me to get things right.

Hope that helps a bit.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to