How to keep Drupal up to date with the GitHub repo?

Drupal has a GitHub repository at http://github.com/drupal/drupal

I, being a newbie to Git and the DVCS world in general, and having trouble figuring out how to use this repo as a method for keeping my Drupal core up to date, so I have the following questions:

  • How to use git locally and push to remote server
  • How to build project from Github? Instructions inconclusive
  • cloning submodule fails
  • Allowing changed file not to be overwritten by git pull
  • git add causes corrupt index error
  • Which Version Control for Drupal?
    • Is this the best way to check out a specific tag from the repo?

      git clone git://github.com/drupal/drupal.git`
      git checkout DRUPAL-6-15
      
    • How about updating to the next release when it becomes available? Just git checkout DRUPAL-6-16?

    • How can I choose to save my own changes (such as modifications to .htaccess) rather than revert back whenever I update?

    • What’s the best way to add my modules and themes into my local git repo, and still retain the ability to update core whenever there’s a new core release? Do I need to create a branch?

  • How to run post-receive hook on GitHub
  • merge branch that was created from old commit to master
  • How to rename a folder in a GitHub repository without the folder appearing to be deleted?
  • “HEAD not found below refs/heads” after I push commit with CR/CRLF changes
  • Cannot deploy static website on azure via Git
  • File ownership/group is changed when users push to a GIT repository
  • 2 Solutions collect form web for “How to keep Drupal up to date with the GitHub repo?”

    Is this the best way to check out a specific tag from the repo?

    Yes. It is the right way.

    How about updating to the next release when it becomes available? Just git checkout DRUPAL-6-16?

    git checkout master
    git pull
    git tag # Lists all tags, contains releases
    git checkout <tagname> # tagname seen in the previous output.
    

    How can I choose to save my own changes (such as modifications to .htaccess) rather than revert back whenever I update?

    One way would be to make all your modifications in a separate branch and merge those changes after you have checked out a release tag.

    What’s the best way to add my modules and themes into my local git repo, and still retain the ability to update core whenever there’s a new core release? Do I need to create a branch?

    You should use git submodule for this. Checkout this answer

    For the record, drupal.org has a very nice guide which does not recommend submodules to keep up to date with core. You just dedicate a branch for this, and a remote pointing to git.drupal.org.

    Git Baby is a git and github fan, let's start git clone.