I am a new user to git
and I am starting a new project. I have a bunch of dot files that I would like to ignore. Is there an ignore command for git
like there is for svn
?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
On Linux/Unix, you can append files to the .gitignore file with the
echo
command. For example if you want to ignore all.svn
folders, run this from the root of the project:It's useful to define a complete .gitignore file for your project. The reward is safe use of the convenient
--all
or-a
flag to commands likeadd
andcommit
.Also, consider defining a global ~/.gitignore file for commonly ignored patterns such as
*~
, which covers temporary files created by Emacs.You have to install git-extras for this. You can install it in Ubuntu using apt-get,
Then you can use the git ignore command.
Using the answers already provided, you can roll your own
git ignore
command using an alias. Either add this to your ~/.gitconfig file:Or run this command from the (*nix) shell of your choice:
You can likewise create a
git exclude
command by replacingignore
withexclude
and.gitignore
with.git/info/exclude
in the above.(If you don't already understand the difference between these two files having read the answers here, see this question.)
for names not present in the working copy or repo:
or for an existing file (sh type command line):