FAQ

IndexTagsArchivesAbout
  • Finding a branch point with Git?

    2022-10-06

    Question I have a repository with branches master and A and lots of merge activity between the two. How can I find the commit in my repository when branch A was created based on master? My repository basically looks like this: -- X -- A -- B -- C -- D -- F (master) \ / \ / \ / \ / G -- H -- I -- J (branch A) I'm looking for revision A, which is not what git merge-base (--all) finds.…

    #git

  • Git: Could not resolve host github.com error while cloning remote repository in git

    2022-10-06

    Question What I did: I have created a remote repository on Github and I am trying to clone the remote repository on my local machine. While cloning I am providing the clone URL & target folder. But every time I try to clone, I am getting this error: Error: "fatal: unable to access 'https://github.com/hyperion057/spring-repo.git/': Could not resolve host: github.com" What do I need to do to connect to GitHub ?…

    #git

  • How can one change the timestamp of an old commit in Git?

    2022-10-06

    Question The answers to How to modify existing, unpushed commits? describe a way to amend previous commit messages that haven't yet been pushed upstream. The new messages inherit the timestamps of the original commits. This seems logical, but is there a way to also re-set the times? Answer You can do an interactive rebase and choose edit for the commit whose date you would like to alter. When the rebase process stops for amending the commit you type in for instance:…

    #git

  • How to git rebase a branch with the onto command?

    2022-10-06

    Question I have noticed that the two blocks of following git commands have different behaviours and I don't understand why. I have an A and a B branches that diverge with one commit ---COMMIT--- (A) \ --- (B) I want to rebase B branch on the lastest A (and have the commit on the B branch) ---COMMIT--- (A) \ --- (B) No problem if I do: checkout B rebase A But if I do:…

    #git

  • Merging between forks in GitHub

    2022-10-06

    Question I forked a GitHub repository. Then I pushed some changes to my fork. Then the original repository merged my changes and some others. Now, I want to merge those changes I'm missing. I tried a simple pull followed by push, but this yield my commits in duplicate. What's the best way to do it? Answer You probably have a "remote" for each repository. You need to pull from one remote and push to the other.…

    #git

  • What's the difference between git reset --mixed, --soft, and --hard?

    2022-10-06

    Question I'm looking to split a commit up and not sure which reset option to use. I was looking at the page In plain English, what does "git reset" do?, but I realized I don't really understand what the git index or staging area is and thus the explanations didn't help. Also, the use cases for --mixed and --soft look the same to me in that answer (when you want to fix and recommit).…

    #git

  • Differences between git pull origin master & git pull origin/master

    2022-10-05

    Question What is the difference between git pull origin master and git pull origin/master ? Answer git pull origin master will pull changes from the origin remote, master branch and merge them to the local checked-out branch. git pull origin/master will pull changes from the locally stored branch origin/master and merge that to the local checked-out branch. The origin/master branch is essentially a "cached copy" of what was last pulled from origin, which is why it's called a remote branch in git parlance.…

    #git

  • «
  • 81
  • 82
  • 83
  • 84
  • 85
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^