Is there a command to undo git init?
You can just delete .git. Typically: rm -rf .git Then, recreate as the right user.
You can just delete .git. Typically: rm -rf .git Then, recreate as the right user.
Try this: git checkout [revision] . where [revision] is the commit hash (for example: 12345678901234567890123456789012345678ab). Don’t forget the . at the end, very important. This will apply changes to the whole tree. You should execute this command in the git project root. If you are in any sub directory, then this command only changes the … Read more
You should just be able to edit the .gitmodules file to update the URL and then run git submodule sync –recursive to reflect that change to the superproject and your working copy. Then you need to go to the .git/modules/path_to_submodule dir and change its config file to update git path. If repo history is different … Read more
The problem is that .gitignore ignores just files that weren’t tracked before (by git add). Run git reset name_of_file to unstage the file and keep it. In case you want to also remove the given file from the repository (after pushing), use git rm –cached name_of_file.
That looks like unix file permissions modes to me (755=rwxr-xr-x, 644=rw-r–r–) – the old mode included the +x (executable) flag, the new mode doesn’t. This msysgit issue’s replies suggests setting core.filemode to false in order to get rid of the issue: git config core.filemode false
Basic rename (or move): git mv <old name> <new name> Case sensitive rename—eg. from casesensitive to CaseSensitive—you must use a two step: git mv casesensitive tmp git mv tmp CaseSensitive (More about case sensitivity in Git…) …followed by commit and push would be the simplest way to rename a directory in a git repo.
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 … Read more
As noted previously, pass in the –no-commit flag, but to avoid a fast-forward commit, also pass in –no-ff, like so: $ git merge –no-commit –no-ff $BRANCH To examine the staged changes: $ git diff –cached And you can undo the merge, even if it is a fast-forward merge: $ git merge –abort
Latest Git: git merge –abort This attempts to reset your working copy to whatever state it was in before the merge. That means that it should restore any uncommitted changes from before the merge, although it cannot always do so reliably. Generally you shouldn’t merge with uncommitted changes anyway. Prior to version 1.7.4: git reset … Read more
All the data Git uses for information is stored in .git/, so removing it should work just fine. Of course, make sure that your working copy is in the exact state that you want it, because everything else will be lost. .git folder is hidden so make sure you turn on the “Show hidden files, … Read more