Git
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
Your repository has no remotes configured to push to
I am using Visual Studio Code and running into the message below while trying to check in. I am using Visual Studio Code and running into the message below while trying to check in. This is right after I upgrade from the April version on the Macintosh to the May version. I upgraded since I … 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
How to answer the git prompt in npm init for a local repo
UPDATE based on comment discussion: IIRC npm init just wants to know what it should write to the attributes of the repository key in package.json. This is optional, so if you don’t have a URL you want to publish in the package.json you should just be able to hit enter and move on. In the … 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
TortoiseGit-git did not exit cleanly (exit code 1)
Try these two commands in git bash: 1) git gc –force 2) git fetch -p
What is the Git equivalent for revision number?
Good or bad news for you, that hash IS the revision number. I also had trouble with this when I made the switch from SVN to git. You can use “tagging” in git to tag a certain revision as the “release” for a specific version, making it easy to refer to that revision. Check out … 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