FAQ

IndexTagsArchivesAbout
  • How do you merge two Git repositories?

    2023-01-17

    Question Consider the following scenario: I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big repository. I'd now like to add A as a subdirectory of B. How do I merge A into B, without losing history on any side? Answer If you want to merge project-a into project-b:…

    #git

  • How to list unpushed Git commits (local but not on origin)

    2023-01-17

    Question How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always. Is this a bug with my install of Git, or am I missing something? Answer This gives a log of all commits between origin/master and HEAD: git log origin/master..HEAD When HEAD is on the master branch, this gives a log of unpushed commits.…

    #git

  • Run git pull over all subdirectories [duplicate]

    2023-01-17

    Question This question already has answers here: </div> Managing many git repositories (25 answers) Closed 5 years ago. How can I update multiple git repositories from their shared parent's directory without cd'ing into each repo's root directory? I have the following which are all separate git repositories (not submodules): /plugins/cms /plugins/admin /plugins/chart I want to update them all at once or at least simplify my current workflow: cd ~/plugins/admin git pull origin master cd .…

    #git

  • Git merge without auto commit

    2023-01-16

    Question Is it possible to do a git merge, but without a commit? "man git merge" says this: With --no-commit perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and further tweak the merge result before committing. But when I try to use git merge with the --no-commit it still auto-commits. Here's what I did: $> ~/git/testrepo$ git checkout master Switched to branch 'master' $> ~/git/testrepo$ git branch…

    #git

  • git pull while not in a git directory

    2023-01-15

    Question Let's say I have a directory, /X/Y, which is a git repository. Is it possible to somehow call a command like git pull from inside /X, but targeting the /X/Y directory? EDIT: I guess I was wondering specifically: is it possible to do this using the a git command, but without having to change directories? NOTE: I've accepted VonC's answer as it's much more elegant than previous options. For people running Git older than 1.…

    #git

  • How do I commit case-sensitive only filename changes in Git?

    2023-01-13

    Question I have changed a few files name by de-capitalize the first letter, as in Name.jpg to name.jpg. Git does not recognize this changes and I had to delete the files and upload them again. Is there a way that Git can be case-sensitive when checking for changes in file names? I have not made any changes to the file itself. Answer As long as you're just renaming a file, and not a folder, you can just use git mv:…

    #git

  • Are Git forks actually Git clones?

    2023-01-12

    Question I keep hearing people say they're forking code in Git. Git "fork" sounds suspiciously like Git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in Git, right? GitHub makes forks a little more real by stapling correspondence onto it. That is, you press the fork button and later, when you press the pull request button, the system is smart enough to email the owner.…

    #git

  • «
  • 51
  • 52
  • 53
  • 54
  • 55
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^