r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

View all comments

Show parent comments

7

u/[deleted] Jun 19 '14

How do I delete remote commit?

You don't. That was easy :-)

How do I make a branch tracking if I failed to do that initially?

Git literally tells you this:

fatal: The current branch fake has no upstream branch.
To push the current branch and set the remote as upstream, use

     git push --set-upstream origin fake

etc...

11

u/moor-GAYZ Jun 19 '14

How do I delete remote commit?

Oops, I meant remote tag. I even more or less remember it by now, it's something like git push :/refs/tags/<tag>. It doesn't make much sense to me, but whatever.

Git literally tells you this:

... if I try to push. Just making a branch tracking is more involved.

And to answer my third question, apparently a "tree-ish" that's definitely not a "commit-ish" should have the form <commit-ish>:<path>, where path can be empty if you want to get a snapshot of the entire repository. This is folk wisdom propagating through forums and stackoverflow, by the way, at least I've never seen anything like that in the FM.

3

u/[deleted] Jun 19 '14

Oops, I meant remote tag

You shouldn't do that either. If someone had pulled that tag down they won't notice you deleted it. They'll forever have the older copy of the tag. (which I admit is a failing in Git).

2

u/moor-GAYZ Jun 19 '14

I'm doing that to then point the tag at a different commit, so that's OK, I think.

-1

u/[deleted] Jun 19 '14

Nope. People who have pulled the old tag will never pull the new one and they won't even know it's out of sync.

2

u/moor-GAYZ Jun 19 '14

git fetch --tags seems to update the tag when I try it.

-2

u/[deleted] Jun 19 '14

git pull won't do that.

→ More replies (0)