About 394,000 results
Open links in new tab
  1. Can you get the number of lines of code from a GitHub repository?

    Nov 12, 2014 · The question “ Count number of lines in a git repository ” asks how to count the lines of code in a local Git repository, but: You have to clone the project, which could be …

  2. How do I delete a local repository in Git? - Stack Overflow

    Oct 3, 2009 · Delete the .git directory in the root-directory of your repository if you only want to delete the git-related information (branches, versions). If you want to delete everything (git …

  3. How do I change the URI (URL) for a remote Git repository?

    First, view the existing remotes to verify which URL is currently set: git remote -v Then, you can set it with: git remote set-url origin <NEW_GIT_URL_HERE> See git help remote. You also …

  4. How do I clone a subdirectory only of a Git repository?

    Note that this will still download the whole repository from the server – only the checkout is reduced in size. At the moment it is not possible to clone only a single directory. But if you …

  5. Moving Git repository content to another repository preserving …

    321 I am trying to move only the contents of one repository (repo1) to another existing repository (repo2) using the following commands: git clone repo1 git clone repo2 cd repo1 git remote rm …

  6. How to determine the URL that a local Git repository was originally ...

    Oct 10, 2015 · 7969 To obtain only the remote URL: git config --get remote.origin.url If you require full output, and you are on a network that can reach the remote repo where the origin resides: …

  7. How can I fix a corrupted Git repository? - Stack Overflow

    Mar 19, 2019 · For example, the patch below can fix a git repo where some object files are damaged. Of course, the recovery is only partial: files in the damaged objects are lost, even …

  8. Synchronizing a local Git repository with a remote one

    git fetch # This updates 'remote' portion of local repo. git reset --hard origin/<your-working-branch> # this will sync your local copy with remote content, discarding any committed # or …

  9. Count number of lines in a git repository - Stack Overflow

    How would I count the total number of lines present in all the files in a git repository? git ls-files gives me a list of files tracked by git. I'm looking for a command to cat all those files.

  10. How do I force "git pull" to overwrite local files?

    Jul 14, 2009 · How do I force an overwrite of local files on a git pull? My local repository contains a file of the same filename as on the server. error: Untracked working tree file 'example.txt' …