Most info about git assumes you want to upload and merge changes and my situation is much simpler than this.

I am trying to ensure I always have and run the newest stable btrfs-progs utilities. To do this I used git clone to download the latest master from here. I could configure and make and it all works well.

Then as time goes by I want to update my local repo to the latest'n'greatest, so I use git pull origin master. But although some updates did go through a few weeks ago I now find that despite running this command (which completes successfully) I am left behind the master. My local repo of btrfs-progs is v3.19-64-g19a806f but the latest at http://git.kernel.org/cgit/linux/kernel/git/kdave/btrfs-progs.git is v4.0. Why didn't my local repo get updated to this? What can I do to always update my repo to the latest master?

  • I'm not a git user, but #git on freenode (IRC channel) is a reasonable place to ask for fast interactive help. And irccloud is an easy to use IRC client from the browser. May 5 '15 at 7:48

You need to git add your local modifications ,
git commit then git pull(it's combination of fetch then merge)
Occasionally you have to fix the merge conflicts.
Check your current status with git log -2

  • I'm not making any local modifications, it is way above my pay grade. I just want to update what I have to the latest online. When I do git pull origin master I don't get the latest. git log -2 reports v4.0 but I have no idea what this means, whether that is what I have locally in my repo (I assume not because git describe --tags reports v3.19-64-g19a806f), or what is upstream.
    – gogoud
    May 5 '15 at 6:46
  • If you just want fresh code, regardless current status. Use following:git reset --hard HEAD git checkout master git pull
    – Jiahao D.
    May 5 '15 at 7:03
  • After that you can git checkout tags/<on your favour> getting tagged release ;)
    – Jiahao D.
    May 5 '15 at 7:04
  • maybe it's a fault in the btrfs-progs setup. I do all this and it says HEAD is now at 19a806f Btrfs progs v4.0 and it confirms Already up-to-date.; then I configure - it succeeds but reports btrfs-progs v3.19-64-g19a806f.
    – gogoud
    May 5 '15 at 7:14
  • I got it! You have the configure files cached(and been ignored by .gitignore). Use git clean -d -x -f to clean your working directory. reference
    – Jiahao D.
    May 5 '15 at 7:33

Despite the suggestions here I couldn't find any way to do this except to delete my local repo and recreate it with git clone. This is slower and seems very wasteful of resources, but unlike all other ideas it actually works and I am now running btrfs-progs v4.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.