About 391,000 results
Open links in new tab
  1. How do I change the URI (URL) for a remote Git repository?

    I had to do this on an old version of git (1.5.6.5) and the set-url option did not exist. Simply deleting the unwanted remote and adding a new one with the same name worked without problem and …

  2. Moving Git repository content to another repository preserving history

    322 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 origin git …

  3. How do I delete a file from a Git repository? - Stack Overflow

    git rm file.txt removes the file from the repo but also deletes it from the local file system. To remove the file from the repo and not delete it from the local file system use: git rm --cached file.txt The below …

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

    Oct 10, 2015 · 7979 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: git remote …

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

    What you are trying to do is called a sparse checkout, and that feature was added in Git 1.7.0 (Feb. 2012). The steps to do a sparse clone are as follows: mkdir <repo> cd <repo> git init git remote add …

  6. git - Checkout to a specific folder - Stack Overflow

    Jun 12, 2024 · Same here git status shows a lot of mods, and git reset doesn't help. I had to git checkout -f HEAD to restore the state of my repo.

  7. Synchronizing a local Git repository with a remote one

    Feb 17, 2019 · 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 …

  8. git - remote add origin vs remote set-url origin - Stack Overflow

    Below will reinitialize your local repo; also clearing remote repos (ie origin): git init Then below, will create 'origin' if it doesn't exist: git remote add origin [repo-url] Else, you can use the set-url …

  9. How to convert existing non-empty directory into a Git working ...

    Now use copied URL to link your local repo with the remote GitHub repo. When you clone a repository with git clone, it automatically creates a remote connection called origin pointing back to the cloned …

  10. Push local Git repo to new remote including all branches and tags

    I have a local Git repo that I would like to push to a new remote repo (brand new repo set up on Beanstalk, if that matters). My local repo has a few branches and tags, and I would like to keep all...