58 questions
2
votes
1
answer
111
views
How to do `git clean -X -e` with overlapping ignores?
I have a curious case with git clean -X. I want to delete all ignored files in a clone, except the .vs folder (which is ignored but should not be deleted).
This works with git clean -Xnd -e !.vs - ...
0
votes
1
answer
301
views
Delete sensitive string from all Git commits
I have internal github in our organization. There is a particular git repo where I need to replace a sensitive string from all commits. There are around 2000 commits and the sensitive string is there ...
0
votes
0
answers
19
views
git and github i have a problem i hope you will help me [duplicate]
please help me i delete all files on my macbook by command ( git clean -fd )
i dont know what i do all files had deleted
i hope you help me
i dont have any idea how to fix it
the command ( git ...
0
votes
0
answers
113
views
I did the git clean -fd command and deleted everything
Please help me! I just f***ed up everything! I was working on a angular crash course project in visual studio and then wanted to commit my changes to git so i first wanted to add my git repo to the ...
3
votes
1
answer
1k
views
Any way to avoid git checkout -f "warning directory is not empty"?
I have a git repository that contains multiple branch that diverged a lot. When I say diverged it means that each branch can contain new folder or submodule and a lot of diffs between files.
When you ...
0
votes
0
answers
3k
views
How can I recover files after running "git clean -df" by accident?
I have accidentally run git clean -df. It removed my files from my current commit, which I had yet to push. Now, in git status, those files are marked with D, which means "deleted".
Is there ...
1
vote
2
answers
112
views
How to print X month ago time before branch name?
Below code I am trying and the output should contain the branch name with x month ago. Any suggestion in this logic would be greatly appreciated.
Here the main aim of the code is to fetch list all ...
0
votes
0
answers
442
views
can't delete ".git" using git clean -xdff
git clean with the -ffxd option does not clean directories called .git - how can I do this?
Using git 2.32.0
mkdir myrepo && cd myrepo
git init .
mkdir src && cd src
touch code.cpp
git ...
1
vote
2
answers
899
views
git clean -fd not removing a folder
I have a GIT repository in a ~/foo folder. Now, created a bar/ folder there with some contents, under ~/foo/public/bar/. It is correctly recognized by GIT as untracked:
~/foo git status -s
?? public/...
1
vote
3
answers
795
views
clean untracked directories only
If I rename some directories, then commit and push to the origin, and later pull from another computer I will find both the old an new directories. In the old directories there will be some ignored ...
1
vote
3
answers
2k
views
Rejected refs in repo-cleaning
I am cleaning a git repository's pull requests (PR). There was one PR created to merge a branch B, which was later considered deprecated and removed before being merged. As a result, branch B was ...
4
votes
0
answers
6k
views
How to reverse 'git clean -xdf' [duplicate]
I accidentaly run:
git clean -xdf
And deleted all the files I needed locally, how can I revert it?
0
votes
1
answer
207
views
Chaining git clean (Porcelain) command
I was trying to perform git clean for some untracked files. I typed the following, unintentionally right, command:
git clean -dn | grep -v <files_to_exclude> | git clean -df
Note that the line ...
-1
votes
3
answers
4k
views
How can i remove untracked changes and deleted files showing on my git terminal
I have been trying to get rid of the untracked files showing up when I run git status on my Git Bash terminal. This has also affected my whole computer system as I usually see different files as well ...
0
votes
0
answers
1k
views
How to restore the files that removed with the git command 'git clean -fdx'
I was so stipud run that command git clean -fdx, and lots of my untracked files had been removed. I searched google again and again for any solutions, but it seems there is no way to get back those ...