project-navigation
Personal tools

Author Topic: Proper GIT command for 2.5 dev current  (Read 3971 times)

Offline Battlescared

  • Squad Leader
  • ****
  • Posts: 107
    • View Profile
Proper GIT command for 2.5 dev current
« on: March 21, 2014, 11:20:25 pm »
Hey all,

Try as I might, I just don't seem to get GIT.  It just doesn't seem to work the way I expect a CM system to work.  I just did a pull from my 2.5 dev directory, which I thought should have been setup to read the 2.5 baseline, but instead it overwrote it with the 2.6 dev baseline.  I don't know how to get a clean version of the latest 2.5 dev.

Can someone give me the exact commands to clone the 2.5 baseline on my disk?  And the separate commands to pull the 2.6 dev baseline?  I want them unique on my disk.

And while you're at it, if you could give me the clue on how to update each of them so I can keep each baseline independent.  If there is an existing post on this, please point me to it.  I haven't found anything that has helped me figure this out.  Thanks.

BS

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #1 on: March 22, 2014, 04:34:10 am »
The git pull did update your repo. That's fine.
What you see on your disk is branch master by default, which is currently 2.6.
To see 2.5, just do a 'git checkout ufoai_2.5'.
And 'git checkout master' to get back to 2.6.

Offline Battlescared

  • Squad Leader
  • ****
  • Posts: 107
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #2 on: March 22, 2014, 01:44:49 pm »
Thanks Duke.  I promise it's on my list to learn git, just haven't had the time to invest in it.

But that didn't work.  It says that "error: pathspec 'ufoai_2.5' did not match any file(s) known to git.".  I also don't quite understand that.  In the one git repository there are all the different versions?  That makes some sense, but what I don't see is any distinction of the branches in the source code.  Does it all get mixed in and the makefiles basically control what goes into the build?  How does it keep track of which branch gets built into the main directory?  Or does it just expect us to manage that manually.  I see very little revision control on the input or output, or at least I don't quite understand it yet.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #3 on: March 22, 2014, 05:26:48 pm »
First off, GIT is great. Period.
I managed to dig up the first article that both gave me an initial understanding and explained WHY it is so great. Here it is:
http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users
After reading the first half of it, I promise you will a) continue and b) eagerly skim every manpage for a solution to your problem ;) Btw it doesn't matter if you don't use eclipse.

Ahh, your problem. IIRC I had the same on one of my machines, but forgot what actually solved it. Probably I just had to add the desired branch to one of the config files.

Offline Battlescared

  • Squad Leader
  • ****
  • Posts: 107
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #4 on: March 22, 2014, 10:12:27 pm »
Ahh, a polite way of saying RTFM.  :)  I get it, maybe.  I like the description on the link you posted  and looks like I am still on the path to understanding GIT.  I'm not really trying to get you to teach me GIT, but I still don't know exactly how you guys are setting the repository up.  Here is a few commands I'm typing  into GIT and their output:

> git branch -la
* master
  remotes/origin/master

So I see one branch in the repository.  Is that correct?  I am using the repository I did a pull on the other day that updated my 2.5-dev repository to 2.6-dev.  I get it that there is only one repository and that's different than I was viewing it before.  I should have everything in this one repo.

So then I look for tags...

> git tag -l
ufoai-040601-source
ufoai-android_2.5.0.06
ufoai-android_2.5.0.07
ufoai-td1-source
ufoai-td2-beta1
ufoai_2.0-rc1
ufoai_2.0-rc3
ufoai_2.0-rc4
ufoai_2.1-dev1

And I get the above list.  How do I get to and select ufoai2.5-dev or 2.6-dev?  I don't see a branch or tag for them, other than I'm pretty sure the master branch is the 2.6-dev.  Is there another construct I should be looking for?  Is td1 or td2 the 2.5 branch or way of accessing it?  I don't quite understand how the repo is setup.

BS

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #5 on: March 22, 2014, 11:16:41 pm »
Actually there are many other branches in the repository, unless you are using github — which only has the master branch — or maybe you only cloned the master branch as per the instructions in the wiki...

What does 'git remote show origin' show?

Offline Battlescared

  • Squad Leader
  • ****
  • Posts: 107
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #6 on: March 23, 2014, 12:08:12 am »
git remote show origin
* remote origin
  Fetch URL: git://git.code.sf.net/p/ufoai/code
  Push  URL: git://git.code.sf.net/p/ufoai/code
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

There's more than one repository?

Offline Battlescared

  • Squad Leader
  • ****
  • Posts: 107
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #7 on: March 23, 2014, 01:00:34 am »
Hmm, ok, not sure where the two repositories got out of sync, but the 2.6-dev version I downloaded earlier has all the branches in it.  I think I have everything.  I don't know how I got a partial repo back in my 2.5 one, but maybe it is still left over from when you guys made the switch, which I think was in the 2.5 development days?  Or had you switched during 2.4?

Anyway, I think I have everything in this repo.  Trying to build 2.5 now.  Think I have it.  Thanks for all the help, Duke.  I appreciate it.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Proper GIT command for 2.5 dev current
« Reply #8 on: March 23, 2014, 01:10:03 am »
Ah, glad to hear that (partial repo? that was odd)

Just to answer your question, yes, we have two repositories: The main one at sourceforge, and a mirror at github — but as I said earlier the one at github only has the master branch... (maybe that's related to your earlier problem? don't know)