Tips for Intermediate Git Users
andyjeffries.co.uk
Tips for Intermediate Git Users
1–10 of 38 posts
Re: Tips for Intermediate Git Users
#2I would have liked to see some points about git-bisect, hooks, etc.
Re: Tips for Intermediate Git Users
#3>A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit.
Umm, you can do this, but in general you should never rename tags. Occasionally a developer will tell me the tag they pushed is incorrect and I'll agree to remove it only if they promise not to re-create it. If you read the man page on git-tag it's clear why you should avoid doing this.
>A lovely little tip – don’t forget that branch names aren’t limited to a-z and 0-9. It can be quite nice to use / and . in names for fake namespacing
If you use '/' is branch names you can create path conflicts. I've seen it happen and it took me a day to debug and figure out. There is some code checking for path conflicts in the git source but it's not invoked via all code paths that create branches. I recommend against using slashes in branch names unless you know what you are doing.
Re: Tips for Intermediate Git Users
#4No tips will help if the history is crap.
Re: Tips for Intermediate Git Users
#5Re: Tips for Intermediate Git Users
#6Re: Tips for Intermediate Git Users
#7This looks like a set of notes that are mostly correct but encourage bad practices. I think it's because they author doesn't understand git and doesn't know what they are doing. >A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit. Umm, you can do this, but in general you should never rename tags. Occasionally a developer will tell me the tag they pushed is inc…
Can you elaborate on this? What you said doesn't make much sense. If having a slash in the branch name creates path conflicts, that means slashes are treated specially, right? How exactly does someone 'know what they are doing' to be able to use them?
Re: Tips for Intermediate Git Users
#8This looks like a set of notes that are mostly correct but encourage bad practices. I think it's because they author doesn't understand git and doesn't know what they are doing. >A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit. Umm, you can do this, but in general you should never rename tags. Occasionally a developer will tell me the tag they pushed is inc…
>If you use '/' is branch names you can create path conflicts. I've seen it happen and it took me a day to debug and figure out. There is some code checking for path conflicts in the git source but it's not invoked via all code paths that create branches. I recommend against using slashes in branch names unless you know what you are doing. Can you elaborate on this? What you said doesn't make much sense. If having a…
Re: Tips for Intermediate Git Users
#9Here is a more useful tip: http://pastebin.com/RP9ZdZY5
Re: Tips for Intermediate Git Users
#10This looks like a set of notes that are mostly correct but encourage bad practices. I think it's because they author doesn't understand git and doesn't know what they are doing. >A lightweight tag is simply a named pointer to a commit. You can always change it to point to another commit. Umm, you can do this, but in general you should never rename tags. Occasionally a developer will tell me the tag they pushed is inc…
>If you use '/' is branch names you can create path conflicts. I've seen it happen and it took me a day to debug and figure out. There is some code checking for path conflicts in the git source but it's not invoked via all code paths that create branches. I recommend against using slashes in branch names unless you know what you are doing. Can you elaborate on this? What you said doesn't make much sense. If having a…
$ git branch fireos
$ git branch fireos/feature-branch
error: unable to create directory for .git/refs/heads/fireos/feature-branch
fatal: Failed to lock ref for update: No such file or directory
This happens because creating 'fireos' branch stores the sha1 in file .git/refs/heads/fireos. But if you later want to create branch 'fireos/feature-branch', git needs to store the sha1 in .git/refs/heads/fireos/feature-branch. This is impossible because 'fireos' is a file and cannot be a directory. Path conflict.