FAQ

IndexTagsArchivesAbout
  • Retrieve the commit log for a specific line in a file?

    2023-07-10

    Question Is there any way to get git to give you a commit log for just commits that touched a particular line in a file? Like git blame, but git blame will show you the LAST commit that touched a particular line. I'd really like to get a similar log of, not the list of commits to anywhere in the file, but just the commits that touched a particular line.…

    #git

  • How to remove remote origin from a Git repository

    2023-07-09

    Question I just did git init to initialize my folder as Git repository and then added a remote repository using git remote add origin URL. Now I want to remove this git remote add origin and add a new repository git remote add origin new-URL. How can I do it? Answer Instead of removing and re-adding, you can do this: git remote set-url origin git://new.url.here See this question: How to change the URI (URL) for a remote Git repository?…

    #git

  • Preferred Github workflow for updating a pull request after code review

    2023-07-09

    Question I've submitted a change to an Open Source project on Github, and received code review comments from one of the core team members. I would like to update the code taking into account the review comments, and re-submit it. What is the best workflow for doing this? From my limited knowledge of git/github, I could do any of the following: Update the code as a new commit, and add both the initial and updated commit to my pull request.…

    #git

  • What is Git fast-forwarding?

    2023-07-08

    Question Is it OK to assume that fast-forward means all commits are replayed on the target branch and the HEAD is set to the last commit on that branch? Answer When you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward, because there isn't any divergent work to merge together—this is called a “fast-forward.…

    #git

  • When to delete branches in Git?

    2023-07-08

    Question Suppose we have an application that's stable. Tomorrow, someone reports a big ol' bug that we decide to hotfix right away. So we create a branch for that hotfix off of "master", we name it "2011_Hotfix", and we push it up so that all of the developers can collaborate on fixing it. We fix the bug, and merge "2011_Hotfix" into "master" as well as into the current development branch. And push "…

    #git

  • How do I clone a Git repository into a specific folder?

    2023-07-07

    Question The command git clone git@github.com:whatever creates a directory named whatever containing a Git repository: ./ whatever/ .git I want the contents of the Git repository cloned into my current directory ./ instead: ./ .git Answer Option A: git clone git@github.com:whatever folder-name Ergo, for right here use: git clone git@github.com:whatever . Option B: Move the .git folder, too. Note that the .git folder is hidden in most graphical file explorers, so be sure to show hidden files.…

    #git

  • How to make Git pull use rebase by default for all my repositories?

    2023-07-07

    Question Is there a way to setup the host Git repository such that any git pull done from its (local) clones uses --rebase by default? By searching on Stack Overflow, I learned about branch.autosetuprebase, but it needs to be configured per clone individually. My project flow is set up such that we pull the develop branch before mergeing a feature branch to it. This pull nearly always uses --rebase, so I am trying to figure out if this can be the default.…

    #git

  • «
  • 6
  • 7
  • 8
  • 9
  • 10
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^