git ************************ git pull ============================ ansible: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html#ansible-collections-ansible-builtin-git-module .. code-block:: yaml tasks: - name: Git拉取代码(clone和pull) ansible.builtin.git: repo: 'git@gitee.com:luzhenxiong/paradox-playground.git' dest: '{{ base_path }}' # 如果目录不存在执行git clone clone: true # 检测revisions, 存在差异执行git pull update: true # 指定master分支 version: master notify: - 收集静态资源 .. warning:: command命令执行git pull的弊端: 总是显示changed。因为每次执行git pull返回 ``Already up to date.`` 这在ansible看来是属于存在变更。 关联远程仓库 ============================ .. tabs:: .. tab:: git .. code-block:: console git remote add origin https://paradox@git.xxxx.com.cn/scm/~paradox/proj.git .. tab:: jetbrains .. image:: /_static/reference/git/define-remote.png git stash =================================== https://git-scm.com/docs/git-stash .. tabs:: .. tab:: git todo .. tab:: jetbrains todo submodule =================================== https://git-scm.com/docs/gitsubmodules#_workflow_for_an_artificially_split_repo