FAQ

IndexTagsArchivesAbout
  • How do I name and retrieve a Git stash by name?

    2023-04-30

    Question How do I save/apply a stash with a name? I don't want to have to look up its index number in git stash list. I tried git stash save "my_stash_name", but that only changes the stash description, and the corresponding git apply "my_stash_name" doesn't work. Answer To save a stash with a message: git stash push -m "my_stash_name" Alternatively (deprecated since v2.16): git stash save "my_stash_name" To list stashes:…

    #git

  • How do I revert all local changes in Git managed project to previous state?

    2023-04-30

    Question I ran git status which told me everything was up to date and there were no local changes. Then I made several consecutive changes and realized I wanted to throw everything away and get back to my original state. Will this command do it for me? git reset --hard HEAD Answer To revert changes made to your working copy, do this: git checkout . Or equivalently, for git version >= 2.…

    #git

  • How to import existing Git repository into another?

    2023-04-29

    Question I have a Git repository in a folder called XXX, and I have second Git repository called YYY. I want to import the XXX repository into the YYY repository as a subdirectory named ZZZ and add all XXX's change history to YYY. Folder structure before: ├── XXX │ ├── .git │ └── (project files) └── YYY ├── .git └── (project files) Folder structure after: YYY ├── .git <-- This now contains the change history from XXX ├── ZZZ <-- This was originally XXX │ └── (project files) └── (project files) Can this be done, or must I resort to using sub-modules?…

    #git

  • ssh: connect to host github.com port 22: Connection timed out

    2023-04-29

    Question I am under a proxy and I am pushing in to git successfully for quite a while. Now I am not able to push into git all of a sudden. I have set the RSA key and the proxy and double checked them, with no avail and git is throwing me the error shown in the title of the page. Answer For my case none of the suggested solutions worked so I tried to fix it myself and I got it resolved.…

    #git

  • go get results in 'terminal prompts disabled' error for github private repo

    2023-04-28

    Question I created the private repo examplesite/myprivaterepo using the Github UI from my browser. Then I went to my go directory (on the desktop) and cloned it: $ cd $GOPATH $ go get github.com/examplesite/myprivaterepo So far so good. Created the file scheduler.go, added to repo, and pushed. $ vim scheduler.go $ git add scheduler.go $ git commit $ git push Everythng's OK. But when I went to a clean laptop and tried to clone the repo, I got an error:…

    #git

  • Pretty Git branch graphs

    2023-04-28

    Question I've seen some books and articles have some really pretty looking graphs of Git branches and commits. How can I make high-quality printable images of Git history? Answer Update: I've posted an improved version of this answer to the Visualizing branch topology in Git question, since it's far more appropriate there. Leaving this answer for historical (& rep, I'll admit) reasons, though I'm really tempted to just delete it.…

    #git

  • Edit the root commit in Git?

    2023-04-25

    Question There's ways to change the message from later commits: git commit --amend # for the most recent commit git rebase --interactive master~2 # but requires *parent* How can you change the commit message of the very first commit (which has no parent)? Answer As of Git version 1.7.12, you may now use git rebase -i --root Documentation

    #git

  • «
  • 21
  • 22
  • 23
  • 24
  • 25
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^