Need help with GIT

Dirk Hohndel dirk at hohndel.org
Thu Sep 3 10:28:10 PDT 2015


On Thu, Sep 03, 2015 at 06:51:36PM +0200, Guido Lerch wrote:
> Hi All,
> 
> I am new to GIT.

Everyone started at some point.

> I have read the contribution document that Dirk has pointed me to but are
> hesitant
> to actually commit anything because I don't want to mess something up or
> lose my
> changes.
> 
> Here is what I did so far ...
> 1. got a master by "git checkout master", "git pull"
> 2. created a branch called "uemis-develop"

That's a good start.

> My master is pretty old, 2-3 weeks.
> 
> Here are some questions
> 1. how can I get a new master and then merge my changes into it without
> affecting anything except my local repository

I would suggest that you don't do that. Simply send me the patches
relative to the older version. I'll deal with the merge.

> 2. Does anyone have a quick guide for dummies so I get a quick start that
> is save ?

It's kinda hard to mess things up with git. Git is very tolerant of user
errors and most things can be undone.

If you really wanted to rebase your changes on top of current master
here's what you'd do:

git fetch origin
git checkout uemis-develop
git rebase -i master

This will show you your commits in an editor (just a list of the hackes
with the command 'pick' in front of each of them). Simply exit the editor
and git will do its best to apply them on top of the latest master.

Now you can once again do

git format-patch master..uemis-develop

and send me the resulting patch files named 0001-..., 0002-..., etc

Makes sense?

/D

PS: and remember, nothing that you do will ever affect the official repo -
you are doing all this on your local machine. So the worst that could
happen is that you end up messing things up with your own files. And if
that worries you, before doing the rebase, simply make a virtual copy of
your changes:
git checkout uemis-develop
git checkout -b uemis-dev-bak
git checkout uemis-develop
now you are back to where you were, but you have a new branch named
uemis-dev-bak that contains things exactly as they are in uemis-develop
right now and no changes to uemis-develop will affect it.


More information about the subsurface mailing list