git clean -fdx
is a command used in Git to remove untracked files and directories from the working tree.
-f
flag stands for "force", which allows the command to execute without prompting the user for confirmation. -d
flag is used to also remove untracked directories. -x
flag is used to also remove ignored files. git clone git@github.com:leandromonaco/leandromonaco.github.io.git C:\Dev\Repo --recurse-submodules
git checkout main
git fetch
git pull
git branch branch_name
git checkout branch_name
git status --short
git add myfile.txt
git commit -m "Made changes to myfile.txt"
git push --set-upstream origin branch_name
git push
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='new@email'; GIT_COMMITTER_NAME='Newname'; GIT_COMMITTER_EMAIL='new@email';" HEAD
git push --force --tags origin 'refs/heads/main'
Run git commit --amend -m "New and correct message"
without destroying the work you've done: git reset --soft HEAD~1
destroying the work you've done: git reset --hard HEAD~1
git rm -r --cached .
to unstage and remove the path to your files from the Git index.git add .
to re-add all your files back (only the correct files will be updated).git commit -m ".gitignore is now working"
to commit all your files back into the Git index.git config --local -l
git config --global -l
git config --global user.name
git config --global user.email
Make sure that local git config does not override the global configuration
git config --local user.name
git config --local user.email
git config --global user.name [username]
git config --global user.email [email address]
Example
winget install -e --id Oracle.JavaRuntimeEnvironment
java -jar bfg.jar --delete-folders ReleasePlanning
git push --force
--no-blob-protection
parameterset GIT_TRACE=1
set GIT_CURL_VERBOSE=1