Git: Checkout all files except one

When I do a git status, I see files like this: modified: dir/A/file.txt modified: dir/B/file.txt modified: dir/C/file.txt modified: dir/D/file.txt What I want to do is to discard changes to all files EXCEPT for dir/C/file.txt I want to do something like this: git checkout — dir/!C/file.txt

Estimate the size of a Git repository before cloning it

Is there any way to estimate the size of a public Git repository without having to clone it? I’d like to use this information to make sure the repository is smaller than a certain size. If it’s not, I don’t want to clone it. I know it can be done on Github but this repository […]

Why does git svn dcommit lose the history of merge commits for local branches?

I have a local git repository created with git svn clone. I make a local branch, make some changes, switch back to master, git svn rebase and if it’s all good, I merge my branch back into master. Then the tree looks something like this: alt text Sometimes, later when I git svn rebase […]

git status shows a file that I have listed explicitly in my .gitignore file

I have the following line in my .gitignore file: var/www/docs/.backroom/billing_info/ but when I type ‘git status’ I am told the following: # modified: var/www/docs/.backroom/billing_info/ I dont understand how a file which is explicitly listed as an ignore pattern could be listed as modified when I want git to ignore it. There are no lines starting […]

How do I get TeamCity to create the .git directory when cloning a repo for build?

I’m trying to run a custom command in my MSBuild file; it basically runs ‘git log -10′ and stores that commit info into a text file. The problem is, when I try to run the build, it errors saying “fatal: Not a git repository”. So I checked TeamCity’s work directory for my project, and there […]

How to ignore a file which is already committed?

Previously, the following was my .gitignore file: … config/database.yml .DS_Store Later I created an app_config.yml file in the config directory and committed it. Now, I realized that I don’t need the app_config.yml file in the git repository. And I modified my .gitignore file: … config/app_config.yml config/database.yml .DS_Store Now, when I commit, that app_config.yml file is […]

Does git support wildcards in paths?

I have looked, searched, and read documentation and can’t really find anything about this. Basically, I want to be able to do this: git reset — *.exe or git reset — */some_executable.exe Instead of this: git reset — some/very/long/path/some_executable.exe Also it’d be nice to be able to do this: git reset — topleveldirectory/another/subdirectory/* Instead of […]

.gitignore not ignoring .idea path

What am I missing that needs to be done in order to get git to ignore my .idea/ path? ctote@ubuntu:~/dev/1$ git status On branch master Your branch is up-to-date with ‘origin/master’. Changes not staged for commit: (use “git add <file>…” to update what will be committed) (use “git checkout — <file>…” to discard changes in […]

To use <git push> on Visual Studio Code, but show “Could not read from remote repository.”

I started studying Git and GitHub. And now, I could create my repository to practice and I could push commits to origin repository(in GitHub) on git bash. But when I tried to push on Visual Studio Code, I have received this error Permission denied (publickey). fatal: Could not read from remote repository. and failed to […]

Git revert merge to specific parent

I have a git repo and am having trouble reverting a merge. The current hash is 0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3. and it has two parents: df1acf5f54426d30f12c6b4558c3dd922297aae3 e19b912404ffd3c153ccac3072dbf22396896d2a doing the following will revert to df1acf5f54426d30f12c6b4558c3dd922297aae3 git revert -m 1 0ce2ca0b35f59af267241cf4d40d16a3e13ba6f3 how do I revert to e19b912404ffd3c153ccac3072dbf22396896d2a?

Git Baby is a git and github fan, let's start git clone.