FAQ

IndexTagsArchivesAbout
  • How can I show what a commit did?

    2023-01-30

    Question A stupid way I know is: git diff commit-number1 commit-number2 Is there a better way? I mean, I want to know the commit1 itself. I don't want to add the commit2 before it as a parameter. Answer git show <commit-id> Documentation for git show

    #git

  • How can I fix the Git error "object file ... is empty"?

    2023-01-29

    Question When I try to commit changes, I get this error: error: object file .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0 is empty fatal: loose object 3165329bb680e30595f242b7c4d8406ca63eeab0 (stored in .git/objects/31/65329bb680e30595f242b7c4d8406ca63eeab0) is corrupt I tried git fsck I've got: error: object file .git/objects/03/dfd60a4809a3ba7023cbf098eb322d08630b71 is empty fatal: loose object 03dfd60a4809a3ba7023cbf098eb322d08630b71 (stored in .git/objects/03/dfd60a4809a3ba7023cbf098eb322d08630b71) is corrupt How can I solve this error? Answer I had a similar problem. My laptop ran out of battery during a Git operation. Boo.…

    #git

  • How do you rename a Git tag?

    2023-01-29

    Question Today I was looking through the logs for a project and realized that I fat fingered a tag name some time ago. Is there some way to rename the tag? Google hasn't turned up anything useful. I realize I could check out the tagged version and make a new tag, I even tried that. But that seems to create a tag object that isn't quite right. For one, git tag -l lists it out of order relative to all of the other tags.…

    #git

  • Git branch command behaves like 'less'

    2023-01-27

    Question When I use the git branch command to list all branches, I see the output of git branch | less. The command git branch is supposed to show a list of branches, like ls does for files. This is the output I get: How do I get the default behaviour of git branch? What causes the paged output? My .gitconfig looks like this: [user] email = myemail@mail.com name = Dennis H.…

    #git

  • How do I "commit" changes in a git submodule? [duplicate]

    2023-01-27

    Question This question already has answers here: </div> Git commit to common submodule (master branch) (7 answers) Closed 10 years ago. I have, in my naivety, set up a git submodule and treated it like a Subversion external - i.e. it's now full of changes that I've just realized haven't been committed or pushed anywhere. Is there some easy way to commit/push the submodule changes back to the upstream repo? And what's the recommended technique in Git for doing simultaneous development on separate (but linked) repositories in this way?…

    #git

  • How can I see which Git branches are tracking which remote / upstream branch?

    2023-01-26

    Question I know I can do git branch --all, and that shows me both local and remote branches, but it's not that useful in showing me the relationships between them. How do I list branches in a way that shows which local branch is tracking which remote? Answer Very much a porcelain command, not good if you want this for scripting: git branch -vv # doubly verbose! Note that with git 1.…

    #git

  • Git command to display HEAD commit id?

    2023-01-25

    Question What command can I use to print out the commit id of HEAD? This is what I'm doing by hand: $ cat .git/HEAD ref: refs/heads/v3.3 $ cat .git/refs/heads/v3.3 6050732e725c68b83c35c873ff8808dff1c406e1 But I need a script that can reliably pipe the output of some command to a text file such that the text file contains exactly the commit id of HEAD (nothing more or less, and not just a ref). Can anyone help?…

    #git

  • «
  • 51
  • 52
  • 53
  • 54
  • 55
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^