Board index FlightGear Development

Entangled in Git and Gitorious  Topic is solved

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Entangled in Git and Gitorious

Postby Necolatis » Sun Dec 01, 2013 7:59 pm

Hi, I might have messed up my local and gitorious clone.

I thought I was supposed to merge the fgdata changes into my gitorious clone. So I did that once in a while, but one day it got messed up somehow. :oops:

I also just read the gitiquette, and see that I am neither supposed to merge fgdata stuff into my clone, and also not supposed to use my callname for checking in.

I still have my plane, and I can commit. But I would like to start from clean Gitorious clone.


Is there any way I can cherrypick all my commits (they are all into my plane folder), into a fresh local AND fresh gitorious clone? And maybe even change to my real name in the process?


Not sure if it matters, but I use Git Extensions, Git GUI and Git bash on Windows 7. I barely dare to do anything now, except commit locally.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Sun Dec 01, 2013 8:18 pm

before we suggest what to do, please run "git status" and "git branch" first and post the output here, and don't run anything before making a backup first.

Normally, you should be fine by doing this:

"git stash && git checkout master && git reset --hard origin/master && git pull origin master"

The first command will stash away any changes, for later retrieval (use git stash list) - the next one will checkout your master branch, and then it will reset the master branch to origin/master, and update master.



In general, you will want to avoid touching master/next and keep them unmodified, so that you can always use "git pull" to update your local clone.
To get stuff committed on top of your own changes (in some topic branch), you would use "git pull --rebase origin/master".
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 1:23 am

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata/Aircraft/JA37 (master)
$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   ../SU-37/Models/Elevation-marker.ac
#       modified:   ../SU-37/Models/SU-37-005-125h.ac
#       modified:   ../SU-37/Models/SU-37-model.xml
#       deleted:    ../SU-37/Nasal/SU-37-AEI-animation.nas
#       deleted:    ../SU-37/Nasal/SU-37-AM.nas
#       deleted:    ../SU-37/Nasal/SU-37-AP-FCS-instrument.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-auto-speedbrake.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-auto-spin-recovery.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-canards.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-elevon-pitch-input.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-elevon-roll-input.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-flaperon-flaps.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-flaperon-roll.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-slats.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-stick-mode.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-throttles.nas
#       deleted:    ../SU-37/Nasal/SU-37-FCS-thrust-vectoring.nas
#       deleted:    ../SU-37/Nasal/SU-37-FOD-screens-animation.nas
#       deleted:    ../SU-37/Nasal/SU-37-auto-land.nas
#       deleted:    ../SU-37/Nasal/SU-37-auto-take-off.nas
#       deleted:    ../SU-37/Nasal/SU-37-autopilot-listeners.nas
#       deleted:    ../SU-37/Nasal/SU-37-drop-view.nas
#       modified:   ../SU-37/SU-37-set.xml
#       deleted:    ../SU-37/SU-37-yasim.xml
#       modified:   ../SU-37/Sounds/SU-37-sound.xml
#       modified:   ../SU-37/Sounds/Samples/flaps.wav
#       modified:   ../SU-37/Sounds/Samples/gear.wav
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       Systems/
#       ../SU-37/Dialogs/menu.xml
#       ../SU-37/Hud/
#       ../SU-37/Models/Effects/
#       ../SU-37/Models/Interior/
#       ../SU-37/Models/Liveries/
#       ../SU-37/Models/test.jpg
#       ../SU-37/Nasal/ILS-31_sup.nas
#       ../SU-37/Nasal/enav.nas
#       ../SU-37/Nasal/instrumentation.nas
#       ../SU-37/Nasal/light.nas
#       ../SU-37/Nasal/liveries.nas
#       ../SU-37/Nasal/low.nas
#       ../SU-37/Nasal/phd.nas
#       ../SU-37/Nasal/radar.nas
#       ../SU-37/Nasal/radar2.nas
#       ../SU-37/Nasal/rwr.nas
#       ../SU-37/Nasal/terrain-map.nas
#       ../SU-37/Nasal/terrain_follow.nas
#       ../SU-37/Sounds/Geforce.wav
#       ../SU-37/Sounds/SU-37-soundOLD.xml
#       ../SU-37/Sounds/Samples/canopy-close2.wav
#       ../SU-37/Sounds/Samples/click.wav
#       ../SU-37/Sounds/Samples/cockpit.wav
#       ../SU-37/Sounds/Samples/engine-exhaust.wav
#       ../SU-37/Sounds/Samples/engine-intake.wav
#       ../SU-37/Sounds/Samples/engine-lowfreq-old1.wav
#       ../SU-37/Sounds/Samples/engine-lowfreq.wav
#       ../SU-37/Sounds/Samples/gunfire_1.wav
#       ../SU-37/Sounds/Samples/reheat-ignite.wav
#       ../SU-37/Sounds/Samples/reheat.wav
#       ../SU-37/Sounds/Samples/shlock.wav
#       ../SU-37/Sounds/Samples/slide.wav
#       ../SU-37/Sounds/Samples/wing-vents.wav
#       ../SU-37/Sounds/flyby.wav
#       ../SU-37/Sounds/geforce1.wav
#       ../SU-37/Sounds/gunfire.wav
#       ../SU-37/Sounds/gunfireOLD.wav
#       ../SU-37/Sounds/mp-sound.xml
#       ../SU-37/Sounds/reheat.wav
#       ../SU-37/Sounds/sonicboom.wav
#       ../SU-37/Systems/autopilot5.xml
#       ../SU-37/splash.jpg
#       ../SU-37/su37-yasim.xml
no changes added to commit (use "git add" and/or "git commit -a")


Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata/Aircraft/JA37 (master)
$ git branch
* master
  master.local


The SU-37 changes was not intended. I properly copied a new version of the plane into the folder (stupid I know). I can just checkout the original folder again?

My own commits are not all forwarded to Gitorious.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Mon Dec 02, 2013 1:39 am

use "git stash" first, then you can check out master again, and if you want to, reset to origin/master - to update things, just run "git pull origin master".

you can then use git cherry-pick to commit useful stuff to a corresponding branch and push things to gitorious
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 2:15 am

Hooray wrote in Mon Dec 02, 2013 1:39 am:use "git stash" first, - to update things, just run "git pull origin master".


Will 'git stash' remember all my commits or just the ones I haven't pushed to my gitorious yet? I would like to retain them all if possible.

Hooray wrote in Mon Dec 02, 2013 1:39 am:then you can check out master again, and if you want to, reset to origin/master


I do want to reset, since I have pushed merges onto gitorious. I should reset before checkout, right?

Hooray wrote in Mon Dec 02, 2013 1:39 am:you can then use git cherry-pick to commit useful stuff to a corresponding branch and push things to gitorious


Okay.
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Mon Dec 02, 2013 2:35 am

stashing will not delete anything at all - anything that hasn't been committed will be saved that way and can be retrieved later: http://git-scm.com/book/en/Git-Tools-Stashing

Code: Select all
git stash &&
git checkout -b messy-master &&
git stash apply &&
git commit -a -m "all the previous mess"


next, you can switch back to your master branch and use "git reset origin/master" to reset back to origin master.
To update things there, use "git pull origin master". You will find your old stuff in the "oldmaster" branch

still, it's a good idea to keep a backup around, after all this is remote-troubleshooting ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 2:58 am

The first part seemed to go well.

Then:

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (messy-master)
$ git checkout master
Switched to branch 'master'

Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (master)
$ git reset origin/master
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Mon Dec 02, 2013 3:00 am

git branch -a
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 3:01 am

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (master)
$ git branch -a
* master
  master.local
  messy-master
  remotes/clone/HEAD -> clone/master
  remotes/clone/PRE_OSG_PLIB_20061029
  remotes/clone/master
  remotes/clone/release/2.10.0
  remotes/clone/release/2.4.0
  remotes/clone/release/2.6.0
  remotes/clone/release/2.8.0
  remotes/clone/releases/2.2.0
  remotes/main/PRE_OSG_PLIB_20061029
  remotes/main/master
  remotes/main/release/2.10.0
  remotes/main/release/2.4.0
  remotes/main/release/2.6.0
  remotes/main/release/2.8.0
  remotes/main/releases/2.2.0
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Mon Dec 02, 2013 3:05 am

git remote -a

git branch -r
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 3:12 am

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (master)
$ git remote -a
error: unknown switch `a'
usage: git remote [-v | --verbose]
   or: git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
   or: git remote rename <old> <new>
   or: git remote remove <name>
   or: git remote set-head <name> (-a | -d | <branch>)
   or: git remote [-v | --verbose] show [-n] <name>
   or: git remote prune [-n | --dry-run] <name>
   or: git remote [-v | --verbose] update [-p | --prune] [(<group> | <remote>)...]
   or: git remote set-branches [--add] <name> <branch>...
   or: git remote set-url [--push] <name> <newurl> [<oldurl>]
   or: git remote set-url --add <name> <newurl>
   or: git remote set-url --delete <name> <url>

    -v, --verbose         be verbose; must be placed before a subcommand
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Hooray » Mon Dec 02, 2013 3:16 am

git remove -v
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11569
Joined: Tue Mar 25, 2008 8:40 am

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 3:18 am

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (master)
$ git remove -v
git: 'remove' is not a git command. See 'git --help'.

Did you mean this?
        remote
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Re: Entangled in Git and Gitorious

Postby Philosopher » Mon Dec 02, 2013 3:18 am

He means remote... (remember? he doesn't like typing on netbooks/tablets ;))
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Entangled in Git and Gitorious

Postby Necolatis » Mon Dec 02, 2013 3:19 am

Code: Select all
Nikolai@NIKOLAI-HP /g/Games/FG/Git/fgdata (master)
$ git remote -v
clone   git@gitorious.org:~necolatis/fg/necolatis-fgdata.git (fetch)
clone   git@gitorious.org:~necolatis/fg/necolatis-fgdata.git (push)
main    git@gitorious.org:~necolatis/fg/fgdata.git (fetch)
main    git@gitorious.org:~necolatis/fg/fgdata.git (push)
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2075
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2019.1.2
OS: Windows 10

Next

Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest