FAQ

IndexTagsArchivesAbout
  • How to recover stashed uncommitted changes

    2023-02-10

    Question I had some uncommitted changes in my development branch and I stashed them using git stash, but there were some changes which were very important among those stashed ones. Is there any way to get back those changes? Also, I have made some changes on top of the stashed code files since. Is there any chance I can retrieve the stashed changes to a new branch if possible? Answer The easy answer to the easy question is git stash apply Just check out the branch you want your changes on, and then git stash apply.…

    #git

  • How do I exit the results of 'git diff' in Git Bash on windows?

    2023-02-09

    Question This question already has answers here: </div> How to exit a 'git status' list in a terminal? (16 answers) </span> Closed 7 years ago. I'm using Git Bash on Windows 7. When I run git diff, I see this: However, I'm unable to get back to a regular prompt. Pressing Ctrl+C seems to work, but as soon as I start typing a command, it's covered up with (END) as in that image.…

    #git

  • Simple tool to 'accept theirs' or 'accept mine' on a whole file using git

    2023-02-09

    Question I don't want a visual merge tool, and I also don't want to have to vi the conflicted file and manually choose the between HEAD (mine) and the imported change (theirs). Most of the time I either want all of their changes or all of mine. Commonly this is because my change made it upsteam and is coming back to me through a pull, but may be slightly modified in various places.…

    #git

  • How are iloc and loc different?

    2023-02-08

    Question Can someone explain how these two methods of slicing are different? I've seen the docs, and I've seen these answers, but I still find myself unable to understand how the three are different. To me, they seem interchangeable in large part, because they are at the lower levels of slicing. For example, say we want to get the first five rows of a DataFrame. How is it that these two work?…

    #python

  • How to move certain commits to be based on another branch in git?

    2023-02-07

    Question The situation: master is at X quickfix1 is at X + 2 commits Such that: o-o-X (master HEAD) \ q1a--q1b (quickfix1 HEAD) Then I started working on quickfix2, but by accident took quickfix1 as the source branch to copy, not the master. Now quickfix2 is at X + 2 commits + 2 relevant commits. o-o-X (master HEAD) \ q1a--q1b (quickfix1 HEAD) \ q2a--q2b (quickfix2 HEAD) Now I want to have a branch with quickfix2, but without the 2 commits that belong to quickfix1.…

    #git

  • Git log to get commits only for a specific branch

    2023-02-05

    Question I want to list all commits that are only part of a specific branch. With the following, it lists all the commits from the branch, but also from the parent (master) git log mybranch The other option I found, was to exclude the commits reachable by master and gives me what I want, BUT I would like to avoid the need of knowing the other branches names. git log mybranch --not master I was trying to use git for-each-ref, but it is also listing mybranch so actually it is excluding all:…

    #git

  • Is it possible to create a remote repo on GitHub from the CLI without opening browser?

    2023-02-05

    Question I created a new local Git repository: ~$ mkdir projectname ~$ cd projectname ~$ git init ~$ touch file1 ~$ git add file1 ~$ git commit -m 'first commit' Is there any git command to create a new remote repo and push my commit to GitHub from here? I know it's no big deal to just fire up a browser and head over to Create a New Repository, but if there is a way to achieve this from the CLI I would be happy.…

    #git

  • «
  • 46
  • 47
  • 48
  • 49
  • 50
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^