Results 1 to 6 of 6

Thread: git + versioning + branches or tags

  1. #1

    Question git + versioning + branches or tags

    Hello forum

    I have a private git repository from where I can clone, push and pull as long as there is internet.

    Now I'm wondering how can I save the current status of the project under a version number or something like that.

    I tried with branches and tags, but it seems that I'm missing something
    Code:
    git branch 3.0
    git checkout 3.0
    # do something, add, commit and push
    That branch exists only in that directory because push didn't upload it to the private repository (or so I think), so I can't checkout 3.0 from other machine and even if I clone the whole project and list the branches 3.0 is nowhere to be found.

    I basically want "head" to point to what I'm doing and still be able to go with my advisor and checkout/clone in his machine something that works, ie: 3.0 in this case.

    Any ideas?

    cheers
    How strange it is, that a fool or a knave, with riches, should be treated with more respect by the world, than a good man, or a wise man in poverty!

  2. #2
    Join Date
    Nov 2006
    Beans
    28

    Re: git + versioning + branches or tags

    Assuming your advisors repository is cloned from yours, you need to have him set up a tracking branch on your 3.0 branch. then after you make changes to the 3.0 have him pull down the changes with something like "git pull origin 3.0". Make sure that the 3.0 branch is checked out when the pull command is issued.

  3. #3

    Re: git + versioning + branches or tags

    Quote Originally Posted by tanderson View Post
    Assuming your advisors repository is cloned from yours,
    The problem is that we can't connect to each other directly, it has to be trough the repository (public ip: ), and I don't know jet how to upload the branch to it.

    I need to do what everyone on sourceforge, github, google code, etc. does:

    Does it compiles and works? give it a new version and announce.

    But I don't know how to do that using git (ie: without making a tar ball of the folder).

    Any ideas?
    How strange it is, that a fool or a knave, with riches, should be treated with more respect by the world, than a good man, or a wise man in poverty!

  4. #4
    Join Date
    Aug 2005
    Location
    The Local Group
    Beans
    631

    Re: git + versioning + branches or tags

    On your machine:
    Code:
    git push origin 3.0
    On the other machine:
    Code:
    git pull origin 3.0

  5. #5

    Re: git + versioning + branches or tags

    Quote Originally Posted by Lux Perpetua View Post
    On your machine:
    Code:
    git push origin 3.0
    That worked, thanks : )
    How strange it is, that a fool or a knave, with riches, should be treated with more respect by the world, than a good man, or a wise man in poverty!

  6. #6
    Join Date
    Aug 2005
    Location
    The Local Group
    Beans
    631

    Re: git + versioning + branches or tags

    Quote Originally Posted by azzamite View Post
    That worked, thanks : )
    Happy to help. Make sure you understand tanderson's post as well: the other computer will need to set up a tracking branch before pulling. You can do this with
    Code:
    git checkout -b 3.0 origin/3.0
    Then you can pull the remote 3.0 branch into the local 3.0 branch. Every time you update the local branch, you need to check it out first.
    Last edited by Lux Perpetua; August 14th, 2011 at 05:11 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •