Uninitialize git repository

git stores all the repository related data in a folder named “.git” inside your repository folder. So you just want to keep your files but change it into a “not-git-repository”. Warning: this is irreversible! The only files that might remain are hidden “.gitignore” files (but only if you added them yourself or using some tool … Read more

How to `git pull` while ignoring local changes?

If you mean you want the pull to overwrite local changes, doing the merge as if the working tree were clean, well, clean the working tree: If there are untracked local files you could use git clean to remove them. git clean -f to remove untracked files -df to remove untracked files and directories -xdf … Read more

Git Pull is Not Possible, Unmerged Files

Say the remote is origin and the branch is master, and say you already have master checked out, might try the following: This basically just takes the current branch and points it to the HEAD of the remote branch. WARNING: As stated in the comments, this will throw away your local changes and overwrite with … Read more

How to recover stashed uncommitted changes

The easy answer to the easy question is git stash apply Just check out the branch you want your changes on, and then git stash apply. Then use git diff to see the result. After you’re all done with your changes—the apply looks good and you’re sure you don’t need the stash any more—then use git stash drop to get rid of it. I … Read more

How do you merge two Git repositories?

A single branch of another repository can be easily placed under a subdirectory retaining its history. For example: This will appear as a single commit where all files of Rails master branch are added into “rails” directory. However the commit’s title contains a reference to the old history tree: Add ‘rails/’ from commit <rev> Where <rev> is a … Read more