Git Help

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Locked
User avatar
Jyby
Posts: 408
Joined: 10 Dec 2013, 04:16

Git Help

Post by Jyby » 04 May 2014, 15:41

I'm trying to stay up to date with the repo. How do I merge without committing it?

When I do a pull request it says my master branch has 100s of changes compared with the OpenMW master.
Macbook Air 2013 - 1.7GHz Intel i7 - 8 GB - 512 GB SSD - Intel HD 5000
Windows 10 PC - 4GHz Intel i7 - 16 GB - 512 GB SSD - EVGA GTX 1060 SSC

User avatar
sirherrbatka
Posts: 2157
Joined: 07 Aug 2011, 17:21

Re: Git Help

Post by sirherrbatka » 04 May 2014, 16:01

Why won't you simply pull OpenMW master into your branch? First add remote to the openmw on openmw, than pull master from that remote using git pull when you are checked on your branch.

User avatar
Jyby
Posts: 408
Joined: 10 Dec 2013, 04:16

Re: Git Help

Post by Jyby » 04 May 2014, 16:39

Git tells me to commit before I can merge.

How can I merge and pull from upstream master without committing the merger?
Macbook Air 2013 - 1.7GHz Intel i7 - 8 GB - 512 GB SSD - Intel HD 5000
Windows 10 PC - 4GHz Intel i7 - 16 GB - 512 GB SSD - EVGA GTX 1060 SSC

User avatar
sirherrbatka
Posts: 2157
Joined: 07 Aug 2011, 17:21

Re: Git Help

Post by sirherrbatka » 04 May 2014, 17:20

I would just stash, create a new branch and merge into it.

User avatar
cc9cii
Posts: 495
Joined: 28 Mar 2013, 04:01

Re: Git Help

Post by cc9cii » 04 May 2014, 22:53

I also had a lot of trouble with git at the beginning. I'm now semi-paranoid, my current workflow using Tortoise git is:
  • work on a branch
  • git stash save
  • git checkout master
  • git fetch upstream
  • git merge upstream/master
  • push to origin (my fork in github)
  • checkout working branch
  • rebase working branch to master
  • stash pop
  • resolve merge issues as required
About once a week so that my repo doesn't get out of sync too much.

User avatar
pvdk
Posts: 523
Joined: 12 Aug 2011, 16:34

Re: Git Help

Post by pvdk » 05 May 2014, 00:13

Jyby wrote:Git tells me to commit before I can merge.
This means there are local changes that haven't been committed yet.

User avatar
psi29a
Posts: 4791
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Git Help

Post by psi29a » 05 May 2014, 06:39

in your branch, commit to it (no worries, it is just your local copy and yes, you can back-out as you haven't pushed), git rebase master.

git rebase master will rebase your current branch on top of the latest master. Translation, it takes your commits in that branch at the time of the branch from master itself and moves it to the side, updates the branch (fast forward) to latest master tip, then overlays your commits on top.

It is the _best_ way to keep your branch up to date with master.

wheybags
Posts: 207
Joined: 21 Dec 2012, 19:41

Re: Git Help

Post by wheybags » 05 May 2014, 08:48

BrotherBrick wrote:It is the _best_ way to keep your branch up to date with master.
Unless you're collaborating with someone else on your branch, becuase it does rewrite your commit history every time.

User avatar
psi29a
Posts: 4791
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Git Help

Post by psi29a » 05 May 2014, 13:31

wheybags wrote:
BrotherBrick wrote:It is the _best_ way to keep your branch up to date with master.
Unless you're collaborating with someone else on your branch, becuase it does rewrite your commit history every time.
Who does that, aside from sadists who still use svn/cvs? Branching is cheap, just do it and ask the one your branching from to review and merge as necessary.

Locked