git config --global --listUse for project agnostic/global gitignore files specific to a developer's setup.
Example contents:
.vscode/touch ~/.gitignore
git config --global core.excludesfile ~/.gitignoregit config --global --add --bool push.autoSetupRemote truegit checkout OTHERBRANCH -- path/to/fileAdd executable permissions to a file and track in git.
git update-index --chmod=+x script.shUndo last commit and move the files back to untracked.
git reset HEAD~To restore a submodule to its original committed state:
git submodule update --init# Update submodule
cd [submodule directory]
git checkout OTHERBRANCH
git pull
# Commit submodule hash change to main project
cd ..
git add [submodule directory]
git commitInteractive rebase with ability to remove commits.
git rebase -i maingit pull origin main --rebase
git push --force- From the forked project, add the upstream project
git remote add upstream [email protected]:UPSTREAM-PROJECT.git- Retrieve upstream changes to main
git fetch upstream
git rebase upstream/main- Push changes to your forked main
git push