I can update my local repo from the upstream repo. That's OK, the two repositories are synced.

But after that, if I want to sync my local repo and the remote repo (so my fork will be identical to my local repo), it creates automatically a new commit (both on my local repo and on my fork) for the merge (.

So, both my local repo and my fork are one commit ahead the Freeorion main repo. And if I want to make a new PR, it contains this useless commit too.

Is it not possible to update the fork from the local repo, like the local repo is updated from the FO main repo?

Thanks.

_________________I release every updated file under the CC-BY-SA 3.0 license.

It is, but for some reason the command needed isn't there as a basic feature in most of the GUIs.

Assumption: you're using Windows and you're using the GitGUI client (which is what I use(d) on Windows).

You can add commands to the menu, I forget which menu option it is (because I'm on Linux with different software) but I think it was one of the furthest right menus on the topbar, and the command you need is "git rebase master", this will rebase your clone from the master branch and then put your work at the top.

Once you've stored it in as a command it should then be possible to do it multiple times without retyping it.

I was also terrible with command line, but I learnt as many git commands as I could because I'm switching systems fairly regularly and remembering a few words to type is easier than leaning completely different buttons to press in radically different GUIs, especially when some of the commands aren't there, despite them being obvious ones.

I hope that helps.

(we don't like using git pull because of all the extra commits it creates, plus it then puts your work amongst other commits which makes it harder to spot new stuff in trunk)

_________________Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

After having read your post numerous times (something like 20 times ^^), I think I begin to understand.

In GitHub Desktop, I can open the command console by right-clicking on the local repo name ("Open in Git Shell"), then I can add commands lines (like "git remote -v" in order to know what are the names and url of each repository), if it's that you mean by "adding commands to the menu".

To be short:

I fetch changes from freeorion/freeorion (upstream) and merge those changes into my local repo ("master"), so the two repositories are synced. > In GitHub Desktop, it just requires to click on "Update from [freeorion]/freeorion/master" button. Local and Upstream are now synced (timeline graphics are on par).

Then I want to push those changes to my fork on GitHub.com ("git push origin master" ?)> In GitHub Desktop, it just requires to click on "Sync" button (if I understand well).

But after that, instead of my fork being synced with my local repo and the upstream repo, my fork master branch is 1 commit ahead freeorion:master, whereas it should display "This branch is even with freeorion:master".

Maybe I'm doing something wrong, or I miss something... Whatever, I will come back tomorrow with some annotated screenshots to better explain.

Thanks again.

_________________I release every updated file under the CC-BY-SA 3.0 license.

Phew, finally did it, and finally understood all you were saying in your post.

The problem came from I thought that the "Update from freeorion/master" button in GitHub Desktop did a "fetch" then a "merge" in my local repo, but like you said, it did a "pull", creating an extra commit, which was pushed to the origin repo (my fork on Github) afterwards.

When I open GitHub Desktop, the "fetch" command is automatically done, I just have to do "git merge freeorion/master" when I'm on my local repo ("master").

Then, if I click on the "Sync" button, the changes are sent correctly to my fork on GitHub. It seems to be equal to "git push origin master", I don't know, but whatever, it works now and my fork is synced without extra commits.

Note: when I do "git merge freeorion/master", there is a warning message: "refname freeorion/master is ambiguous". Is this normal?

Thanks again, you were right, once that's understood, it's not so complicated.

_________________I release every updated file under the CC-BY-SA 3.0 license.

Note: when I do "git merge freeorion/master", there is a warning message: "refname freeorion/master is ambiguous". Is this normal?

No it isn't. A refname is a symbolic and human readable name to an actual commit, and can be a branch name, a tag, a branch on a remote, …. For example: if you happen to create a local branch called 'freeorion/master' (yes, branch names can contain slashes, in fact you can organize them in folders) and you happen to name the upstream repository remote 'freeorion' it would happen that there is a remote branch called 'freeorion/master' both would have the same name therefor would be ambiguous, because git doesn't know if you meant the local branch or the remote branch when executing an operation. If you know that wasn't intendent by you you can rename the ref by giving its canonical name. Just execute 'git show-ref' to see all available refs. You can delete it with 'git update-ref -d <canonical name>', where the canonical name is the path to the offending ref startings with 'refs/' or rename it with 'git branch -m <oldbranch name> <newbranch name>'.

I gave up on using Github for Windows due to issues such as this, and the general inability to control what it's doing in terms of pulling/fetching or pushing when clicking the sync button. Instead I've been using TortoiseGit, which lets me do most of what I need, though still with occasional mistakes / unintended results (mainly when trying to work with branches instead of committing directly to master always).

As Geoff said, GitHub Desktop is not a very good GUI for git. Apparently it has a lot of issues. The two GUIs I'm using and can recommend are SourceTree and SmartGit. IMO SourceTree is clearer and simpler to use, while SmartGit seems a bit more powerful (e.g. built-in conflict solver, which SourceTree lacks). Both are free for personal (non-commercial) use and available for Windows, Mac OSX and Linux.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum