Size: 225
Comment:
|
Size: 1849
Comment: Link
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
'''Git''' is a version control system designed to be used in a distributed ecosystem and primarily interfaced in a terminal (i.e. `git(1)`). Compare to [[Cvs|CVS]]. |
|
Line 8: | Line 12: |
== Installation == | |
Line 9: | Line 14: |
== Git Versioning System == | All [[Linux]] distributions offer a `git` package. Most [[BSD]] distributions do as well. |
Line 11: | Line 16: |
See: * [[Git/Branches|GitBranches]] |
On [[Windows]], see the [[https://gitforwindows.org/|Git for Windows]] project. |
Line 19: | Line 22: |
== Web Interfaces == | == Usage == |
Line 21: | Line 24: |
See: | To begin tracking a directory, run `git init`. This creates a `.git` folder to maintain the internal state of the version control system. |
Line 23: | Line 26: |
* !GitWeb * [[CGit|CGit]] |
Use `git status` to show the current state in a human-readable format. === Branches === For more information about using branches, see [[Git/Branches|here]]. === Submodules === To clone a repository that uses submodules, try: {{{ git clone --recurse-submodules [email protected]:example/example.git }}} Alternatively, submodules can be pulled in a separate step. {{{ git clone [email protected]:example/example.git cd example git submodule update --init --recursive }}} To add a submodule, try: {{{ git submodule add [email protected]:example/subexample }}} To delete a submodule, try: {{{ git submodule deinit subexample }}} ---- == Troubleshooting == === Fatal error when cloning a remote repository === If git fails to clone a remote repository, possibly with one of the following error messages: {{{ fatal: fetch-pack: invalid index-pack output ... fatal: early EOF fatal: index-pack failed }}} Then try a '''shallow clone''' first: {{{ git clone --depth 1 https://example.com/repo.git git fetch --unshallow git pull --all }}} ---- == See also == [[https://man.archlinux.org/man/git.1|git(1)]] [[Git/GitShell|git-shell]] [[CGit|CGit]] |
Git
Git is a version control system designed to be used in a distributed ecosystem and primarily interfaced in a terminal (i.e. git(1)).
Compare to CVS.
Contents
Installation
All Linux distributions offer a git package. Most BSD distributions do as well.
On Windows, see the Git for Windows project.
Usage
To begin tracking a directory, run git init. This creates a .git folder to maintain the internal state of the version control system.
Use git status to show the current state in a human-readable format.
Branches
For more information about using branches, see here.
Submodules
To clone a repository that uses submodules, try:
git clone --recurse-submodules [email protected]:example/example.git
Alternatively, submodules can be pulled in a separate step.
git clone [email protected]:example/example.git cd example git submodule update --init --recursive
To add a submodule, try:
git submodule add [email protected]:example/subexample
To delete a submodule, try:
git submodule deinit subexample
Troubleshooting
Fatal error when cloning a remote repository
If git fails to clone a remote repository, possibly with one of the following error messages:
fatal: fetch-pack: invalid index-pack output ... fatal: early EOF fatal: index-pack failed
Then try a shallow clone first:
git clone --depth 1 https://example.com/repo.git git fetch --unshallow git pull --all