wiki.xw3.org

Welcome, this is not the xw3 project Wiki... But it is part of the xw3.org development infrastructure.

User Tools

Site Tools


git

Git

Clone a specific tag

git clone --depth 1 --branch <tag_name> <repo_url>

Specify the private SSH-key to use when executing a Git command:

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'

Source: https://stackoverflow.com/questions/4565700/how-to-specify-the-private-ssh-key-to-use-when-executing-shell-command-on-git

Remove submodule

  1. mv a/submodule a/submodule_tmp
  2. git submodule deinit -f – a/submodule
  3. rm -rf .git/modules/a/submodule
  4. git rm -f a/submodule # Note: a/submodule (no trailing slash)

    or, if you want to leave it in your working tree and have done step 0

  5. git rm –cached a/submodule

3bis mv a/submodule_tmp a/submodule

Source: https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule

How to undo local changes to a specific file

Undo all uncommitted or unsaved changes

Getting the difference between two repositories

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

git.txt · Last modified: 2024-03-23 by hanez