FAQ

IndexTagsArchivesAbout
  • What's the difference between 'git merge' and 'git rebase'?

    2023-03-11

    Question What's the difference between git merge and git rebase? Answer Suppose originally there were 3 commits, A,B,C: Then developer Dan created commit D, and developer Ed created commit E: Obviously, this conflict should be resolved somehow. For this, there are 2 ways: MERGE: Both commits D and E are still here, but we create merge commit M that inherits changes from both D and E. However, this creates diamond shape, which many people find very confusing.…

    #git

  • How do I list all remote branches in Git 1.7+?

    2023-03-09

    Question I've tried git branch -r, but that only lists remote branches that I've tracked locally. How do I find the list of those that I haven't? (It doesn't matter to me whether the command lists all remote branches or only those that are untracked.) Answer For the vast majority[1] of visitors here, the correct and simplest answer to the question "How do I list all remote branches in Git 1.…

    #git

  • How to check for changes on remote (origin) Git repository

    2023-03-09

    Question What are the Git commands to do the following workflow? Scenario I cloned from a repository and did some commits of my own to my local repository. In the meantime, my colleagues made commits to the remote repository. Now, I want to: Check whether there are any new commits from other people on the remote repository, i.e. origin? Say there were three new commits on the remote repository since my last pull, I would like to diff the remote repository's commits, i.…

    #git

  • Send a pull request on GitHub for only latest commit

    2023-03-09

    Question I forked a project on github and am successfully making changes to my local master and pushing to origin on github. I want to send a pull request, but only want to include the last commit. The pull request UI on github.com shows the last 9 commits and I don't know how to filter that down. I was trying to understand if I should create a new local branch, check that out and somehow reset or rebase to upstream?…

    #git

  • Change name of folder when cloning from GitHub?

    2023-03-08

    Question When I clone something from Github, it creates a folder with the same name as the app on my computer. Is there a way to change the name? For example, doing this clone creates a long "sign-in-with-twitter" folder: git clone https://github.com/sferik/sign-in-with-twitter.git I know I can rename the folder after, but I'm wondering if there's a way to rename it as it comes in by adding an option at the end of the statement.…

    #git

  • How can I revert a single file to a previous version? [duplicate]

    2023-03-08

    Question This question already has answers here: </div> How do I reset or revert a file to a specific revision? (36 answers) Closed 9 years ago. Is there a way to go through different commits on a file. Say I modified a file 5 times and I want to go back to change 2, after I already committed and pushed to a repository. In my understanding the only way is to keep many branches, have I got that right?…

    #git

  • Git checkout: updating paths is incompatible with switching branches

    2023-03-06

    Question My problem is related to Fatal Git error when switching branch. I try to fetch a remote branch with the command git checkout -b local-name origin/remote-name but I get this error message: fatal: git checkout: updating paths is incompatible with switching branches. Did you intend to checkout 'origin/remote-name' which can not be resolved as commit? If I manually create a branch and then pull the remote branch, it works, just as making a new clone and checking the branch out.…

    #git

  • «
  • 31
  • 32
  • 33
  • 34
  • 35
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^