Search code examples
gitmergegit-mergelocal-files

Merge local files than pushing to git


So, I have a cloned repo on my machine.(folder A). And I have another folder in which my files are updated, but it is not a git repo.(folder B). I would like to merge all files and folders from folder B with folder A (which is my cloned repo). The rest is easy, just git add, git commit and git push. Thanks!


Solution

  • I do it like this

    aa=/path/to/folder-a
    bb=/path/to/folder-b
    
    cd $aa
    git rm -qr .
    cp -r $bb/. .
    git add -A
    git commit
    git push
    

    ref