大约有 2,878 项符合查询结果(耗时:0.0161秒) [XML]
Undo a Git merge that hasn't been pushed yet
Within my master branch, I did a git merge some-other-branch locally, but never pushed the changes to origin master. I didn't mean to merge, so I'd like to undo it. When doing a git status after my merge, I was getting this message:
...
Why does Git treat this text file as a binary file?
I wonder why git tells me this:?
14 Answers
14
...
git pull error :error: remote ref is at but expected
...
If you are running git under a file system that is not case sensitive (Windows or OS X) this will occur if there are two branches with the same name but different capitalisation, e.g. user_model_changes and User_model_changes as both of the rem...
Retrieve a single file from a repository
...ed and disk space used) to get the contents of a single file from a remote git repository?
21 Answers
...
How can I reset or revert a file to a specific revision?
...
Assuming the hash of the commit you want is c5f567:
git checkout c5f567 -- file1/to/restore file2/to/restore
The git checkout man page gives more information.
If you want to revert to the commit before c5f567, append ~1 (where 1 is the number of commits you want to go back,...
Unstage a deleted file in git
...
Assuming you're wanting to undo the effects of git rm <file> or rm <file> followed by git add -A or something similar:
# this restores the file status in the index
git reset -- <file>
# then check out a copy from the index
git checkout -- <file>
...
GitHub: How to make a fork of public repository private?
...id (details here):
Create a new repo (let's call it private-repo) via the Github UI. Then:
git clone --bare https://github.com/exampleuser/public-repo.git
cd public-repo.git
git push --mirror https://github.com/yourname/private-repo.git
cd ..
rm -rf public-repo.git
Clone the private repo so yo...
Global Git ignore
I want to set up Git to globally ignore certain files.
12 Answers
12
...
git replacing LF with CRLF
Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository.
20 Answ...
When to delete branches in Git?
...
You can safely remove a branch with git branch -d yourbranch. If it contains unmerged changes (ie, you would lose commits by deleting the branch), git will tell you and won't delete it.
So, deleting a merged branch is cheap and won't make you lose any history....