I'm mostly interested in a client with a GUI that works in Windows, but also it would be nice to know if there is a command line script/extension that does this.
Let's say, you have a git repo, with submodules inside. The client, when ran inside a git repository, should allow for a git pull
, with the following steps:
- (The client shows the current revisions/commit hashes, and possibly tags, for the current branch, both for the main repository current branch, and for any/all submodules in current branch; and also for other branches of the main repository)
- If there are untracked files in the repo, it raises a warning prompt: "Note, you have untracked files in the repository. Would you like to remove them before proceeding (i.e.
git clean -dfx
)?" [Yes] - deletes file (doesgit clean -dfx
), [No] - leaves files in place, and proceeds, [Cancel] - cancels operation - If there are "Changes not staged for commit", it raises a warning prompt: "Note: you have changes not staged for commit, git pull is likely to fail because of this. Should the changes be discarded (i.e.
git checkout -- $(git rev-parse --show-toplevel)
)?" [Yes] - discards changes repository-wide (for current branch); [No] - leaves files in place, and proceeds, [Cancel] - cancels operation - It then does a
git pull
(prompting for username/password if applicable); by default,git
here will fetch all commits in the remote, and will merge the changes, and checkout the latest commit for the current repo. Also, ifgit
notices the submodules have had their changed commit hash changed, it will also fetch the new commits for the submodules (prompting for username/password again if needed) - however it will not checkout the right revision inside the submodules. - Thus, after this operation, the client should look at each submodule, and - if the current revision (commit hash) of the submodule does not match, then the client first prompts "Would you like to update the submodule XXXX to the commit requested by the latest state of the main repository"? [No] cancels the submodule update, [Yes]: first repeats the prompts for untracked files and uncommitted changes in the submodule, and then does a pull (or checkout?) of the right revision, that is linked to the current revision of the main/parent repository.
- After the submodules are handled, the client should check again the main repository - if there are multiple branches in the repository, the previous
git pull
would have gotten the new commits for the branches as well, but will not update the branches to be at those commits. For all branches where that is the case, the client should prompt: "Would you like to update branch XXXX to the latest commit?", [Yes] - it does so (probably viagit pull
again), [No] - skips the update for that branch - At end: (The client shows the current revisions/commit hashes, and possibly tags, for the current branch, both for the main repository current branch, and for any/all submodules in current branch; and also for other branches of the main repository)
So - is there anything like this out there?