Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Using Git just keeping Vanilla Core + Addons up-to-date (as a user, not a dev)?

I have to confess that I'm a little lost with using git. I only want to keep the cloned git repository up-to-date, but I'm not sure I'm doing it right:

  • I have successfully cloned Garden and Addons
  • I have switched garden to the 2.1 branch and left addons at master branch

When I enter the Garden or Addons directory and try git pull the following happens:

# git pull
remote: Counting objects: 263, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 163 (delta 123), reused 146 (delta 106)
Receiving objects: 100% (163/163), 15.49 KiB, done.
Resolving deltas: 100% (123/123), completed with 49 local objects.
From git://github.com/vanillaforums/Garden
   c7a3a72..2b42695  master     -> origin/master
   c9374c8..6a3282f  release/2.2 -> origin/release/2.2
You asked me to pull without telling me which branch you
want to merge with, and 'branch.2.1.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.2.1.remote = <nickname>
    branch.2.1.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

See git-config(1) for details.

I am clearly missing something, but I have no idea what. Any hint?

Tagged:

Comments

  • lifeisfoolifeisfoo ✭✭✭

    I use git fetch instead of git pull, since fetch only fetch changes, without auto merge.

    Let me explain a tipical workflow:

    • Clone Garden at my github (lifeisfoo/Garden), using github "fork" button
    • Clone Garden repo on my pc using git clone https://github.com/lifeisfoo/Garden.git. This repository is now my origin repository
    • Add main vanilla repo as a git remote repository git remote add upstream https://github.com/vanillaforums/Garden.git

    Now I can keep my repository up-to-date:

    • git fetch upstream to get vanilla main repo changes locally
    • git merge upstream/release/2.2 release/2.2 to update my local release/2.2 branch
    • if you are in another branch (e.g. created with git checkout -b my-branch upstream/release/2.2) you need to update this branch too, using git merge upstream/release/2.2 my-branch-upstream or git merge release/2.2 my-branch-upstream if release/2.2 is up-to-date.
    • now, if you want, you can update your origin github repo using git push origin

    Note that if don't want to make changes to Garden, the origin repository is useless and you can clone vanilla/Garden directly (becoming your origin repo).

    I hope this help

    There was an error rendering this rich post.

Sign In or Register to comment.