git tag TAG
git push origin TAG
git push origin --tags
Source: https://stackoverflow.com/questions/18216991/create-a-tag-in-a-github-repository
git clone --depth 1 --branch <tag_name> <repo_url>
ssh-agent bash -c 'ssh-add /home/git/.ssh/key-filename; git $GIT_COMMAND'
Example:
ssh-agent bash -c 'ssh-add /home/git/.ssh/key-filename; git push'
3bis mv a/submodule_tmp a/submodule
Source: https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule
git checkout .
Or:
git checkout [some_dir|file.txt]
Source: https://stackoverflow.com/questions/14075581/git-undo-all-uncommitted-or-unsaved-changes
git checkout -- <file>
Source: https://stackoverflow.com/questions/31281679/how-to-undo-local-changes-to-a-specific-file
git remote add -f b path/to/repo_b.git git remote update git diff master remotes/b/master git remote rm b
Source: https://stackoverflow.com/questions/1968512/getting-the-difference-between-two-repositories
So, first commit/push your submodule's changes:
cd path/to/submodule git add <stuff> git commit -m "comment" git push
Then, update your main project to track the updated version of the submodule:
cd /main/project git add path/to/submodule git commit -m "updated my submodule" git push
Source: https://stackoverflow.com/questions/5542910/how-do-i-commit-changes-in-a-git-submodule
git filter-branch --force --index-filter "git rm -r --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA" --prune-empty --tag-name-filter cat -- --all git push --force --verbose --dry-run git push --force
Source: https://stackoverflow.com/questions/872565/remove-sensitive-files-and-their-commits-from-git-history