FAQ

IndexTagsArchivesAbout
  • Recursively add the entire folder to a repository

    2022-12-13

    Question I am trying to add a branch to the master branch on GitHub and push a folder onto that branch. The folder structure of the branch looks like - SocialApp/SourceCode/DevTrunk/SocialApp and all the source code files are in the last folder. I am using the following Git commands: git add * git commit -m with the message git push This is pushing only the first folder "SocialApp" onto GitHub and ignoring the folder SourceCode that is inside the folder.…

    #git

  • Are multiple `.gitignore`s frowned on?

    2022-12-11

    Question Unless a repo consisted of several independent projects, it seems it would be simplest to just have one .gitignore file at the root of the repo than various ones throughout. Is there a standard best practice on this or some analysis online of when one approach is better than the other? Answer I can think of at least two situations where you would want to have multiple .gitignore files in different (sub)directories.…

    #git

  • GitHub: How to make a fork of public repository private?

    2022-12-11

    Question How can I fork a public repository, but make my fork private? I do have the subscription to support private repositories. Answer The answers are correct but don't mention how to sync code between the public repo and the fork. Here is the full workflow (we've done this before open sourcing React Native): First, duplicate the repo as others said (details here): Create a new repo (let's call it private-repo) via the Github UI.…

    #git

  • How can I view an old version of a file with Git?

    2022-12-11

    Question Is there a command in Git to see (either dumped to stdout, or in $PAGER or $EDITOR) a particular version of a particular file? Answer You can use git show with a path from the root of the repository (./ or ../ for relative pathing): $ git show REVISION:path/to/file Replace REVISION with your actual revision (could be a Git commit SHA, a tag name, a branch name, a relative commit name, or any other way of identifying a commit in Git)…

    #git

  • How to git log from all branches for the author at once?

    2022-12-11

    Question I need to get the report of all commits that the author did. So far, I have the script that wraps the following command: git log --pretty=format:"%ad:%an:%d:%B" --date=short --reverse --all --since=2.months.ago --author=Petr It works fine. However, it reports only the actions of the current branch. Is there any option that would log the commit messages for the author from all branches, not only from the current one? In other words, can git make a reverse sorted (by datetime) sequence of all the commits in repository and extract the log info from that sequence?…

    #git

  • fetch in git doesn't get all branches

    2022-12-10

    Question I have cloned a repository, after which somebody else has created a new branch, which I'd like to start working on. I read the manual, and it seems dead straight easy. Strangely it's not working, and all the posts I've found suggest I'm doing the right thing. So I'll subject myself to the lambasting, because there must be something obviously wrong with this: The correct action seems to be git fetch git branch -a * master remotes/origin/HEAD --> origin/master remotes/origin/master git checkout -b dev-gml origin/dev-gml At this point there is a problem, for some reason after git fetch I can't see the dev-gml remote branch.…

    #git

  • How do I resolve merge conflicts in a Git repository?

    2022-12-09

    Question How do I resolve merge conflicts in my Git repository? Answer Try: git mergetool It opens a GUI that steps you through each conflict, and you get to choose how to merge. Sometimes it requires a bit of hand editing afterwards, but usually it's enough by itself. It is much better than doing the whole thing by hand certainly. As per Josh Glover's comment: [This command] doesn't necessarily open a GUI unless you install one.…

    #git

  • «
  • 61
  • 62
  • 63
  • 64
  • 65
  • »

©2023 hugo-notepadium-mod

CC BY-NC-SA 4.0 | RSS

Powered by Hugo and the Notepadium-mod

^ TOP ^