---
title: "Discussion on \"How to move a directory from one git repo to another (or new) without losing history\" | Hashnode"
description: "Discussion on \"How to move a directory from one git repo to another (or new) without losing history\". Make copy of repo\ngit clone dirtySourceRepo newSourceRepo\nOR clone from actual git repo and prevent push\ngit remote set-url --push origin no_push\n\nMake sure to checkout the correct branch before the next step.\n\nCloning from another local directory al..."
url: "https://hashnode.com/posts/how-to-move-a-directory-from-one-git-repo-to-another-or-new-without-losing-history/619eb1945993b91bb7d1ed56"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to move a directory from one git repo to another (or new) without losing history](https://blog.kerchum.dev/how-to-move-a-directory-from-one-git-repo-to-another-or-new-without-losing-history?utm_source=hashnode&utm_medium=feed)

Make copy of repo git clone dirtySourceRepo newSourceRepo OR clone from actual git repo and prevent push git remote set-url --push origin no\_push Make sure to checkout the correct branch before the next step. Cloning from another local directory al...

Nov 24, 2021 · 1 min read · blog.kerchum.dev  
Read the article

-   [#git](https://hashnode.com/tag/git)
-   [#repository](https://hashnode.com/tag/repository)
-   [#version-control](https://hashnode.com/tag/version-control)
-   [#microservices](https://hashnode.com/tag/microservices)

## Written by

[Alexander Kerchum](https://hashnode.com/@ajkerchum)

@ajkerchum

  
[View profile](https://hashnode.com/@ajkerchum)

Senior Software Engineer at Upstart

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
