Difference between revisions of "Git"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
[[thing type::software]]
 
[[thing type::software]]
 
[[license::open source]]
 
[[license::open source]]
</hide>
+
</hide>__NOTOC__
 
==About==
 
==About==
[[Git]] is a [[version control system]] based on a powerful distributed model.{{seed}}
+
[[Git]] is a [[version control system]] based on a powerful distributed model.
 +
===Pages===
 +
* '''[[/cmd|commands]]'''
 +
* '''concepts''':
 +
** [[/squash]]ing
 +
** [[/modules]]
 
* [[/notes]]
 
* [[/notes]]
==Concepts==
 
* [[/squash]]ing
 
* [[/modules]]
 
  
==Commands==
 
{|
 
|-
 
! alphabetical !! by function
 
|-
 
| valign=top |
 
* '''[[/add|git add]]''' updates the "staged" area using content found in the working tree (can be specified)
 
* '''[[/branch|git branch]]''' manages {{l/sub|branch}}es
 
* '''[[/checkout|git checkout]]'''
 
* '''[[/clone|git clone]]''' copies a repository from somewhere else
 
* '''[[/commit|git commit]]''' commits changes currently staged
 
* '''[[/commit-tree|git commit-tree]]
 
* '''[[/config|git config]]'''
 
* '''[[/diff|git diff]]''' shows difference between current directory contents and what you have staged
 
* '''[[/fetch|git fetch]]''' fetches named heads or tags from one or more other repositories, along with the objects necessary to complete them.
 
* '''[[/init|git init]]''' initializes a new repository; does not add anything
 
* '''[[/log|git log]]''' returns information about {{l/sub|commit}}s
 
* '''[[/merge|git merge]]''' joins two or more {{l/sub|branch}}es together
 
* '''[[/pull|git pull]]''' incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.
 
* '''[[/push|git push]]''' updates remote refs using local refs, while sending objects necessary to complete the given refs
 
* '''[[/rebase|git rebase]]''' forward-port local commits to the updated upstream head
 
* '''[[/read-tree|git read-tree]]
 
* '''[[/remote|git remote]]''' manage aliases for remote repositories
 
* '''[[/reset|git reset]]''' resets current HEAD to the specified state
 
* '''[[/rm|git rm]]''' removes files from staging '''and by default also from the filesystem'''
 
* '''[[/show|git show]]'''
 
* '''[[/stash|git stash]]''' saves local modifications, reverts the working directory to match HEAD commit
 
* '''[[/status|git status]]''' shows status of current repository
 
* '''[[/tag|git tag]]''' creates an alias for a particular revision
 
* '''[[/worktree|git worktree]]
 
* '''[[/write-tree|git write-tree]]
 
| valign=top |
 
===initialization===
 
* '''[[/config|git config]] --global {{arg|param_name}} {{arg|param_value}}'''
 
===creating from scratch===
 
* '''[[/init|git init]]''' initializes a new repository; does not add anything
 
* '''[[/add|git add]]''' updates the index using content found in the working tree (can be specified), to prepare the content staged for the next commit
 
* '''[[/rm|git rm]]''' removes files from staging '''and by default also from the filesystem'''
 
* '''[[/status|git status]]''' shows status of current repository
 
* '''[[/diff|git diff]]''' shows difference between current directory contents and what you have staged
 
* '''[[/commit|git commit]]''' commits changes currently staged
 
===copying to elsewhere===
 
* '''[[/remote|git remote]] add'''
 
* '''[[/push|git push]]'''
 
===copying from elsewhere===
 
* '''[[/clone|git clone]]''' copies a repository from somewhere else
 
|}
 
 
===Files===
 
===Files===
 
* {{l/sub|gitignore}}
 
* {{l/sub|gitignore}}
 
===Software===
 
===Software===
* [https://git-scm.com/downloads/guis GUI clients]:
+
* '''3rd-party''':
** [[gitk]]: generally distributed with git
+
** [https://git-scm.com/downloads/guis GUI clients]:
** [[git-cola]]
+
*** [[gitk]]: generally distributed with git
* [https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols 10.6 Git Internals - Transfer Protocols]: technical details
+
*** [[git-cola]]
** could be used to implement a Git server
+
* '''internals/technical''':
 
+
** [https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols 10.6 Git Internals - Transfer Protocols]: could be used to implement a Git server
===Services===
+
* '''services''' - free/open source web-based repository/project managers:
* [[GitHub]]: free web-based git repository for open-source projects
+
** [[Gitea]]
 +
** [[GitHub]] is unfortunately owned by [[Microsoft]]
 +
** [[GitLab]]
 
===Error Messages===
 
===Error Messages===
 
* '''Error Code 403 fatal: HTTP request failed''' may indicate a bad password. I've found that sometimes the password either doesn't paste properly or else isn't being accepted the first time; trying again with the same password may work. (The password is not displayed, so I'm not sure which it is.)
 
* '''Error Code 403 fatal: HTTP request failed''' may indicate a bad password. I've found that sometimes the password either doesn't paste properly or else isn't being accepted the first time; trying again with the same password may work. (The password is not displayed, so I'm not sure which it is.)
 
 
==Links==
 
==Links==
 
===Reference===
 
===Reference===
Line 78: Line 34:
 
* {{l/manpage|git|manpage}}
 
* {{l/manpage|git|manpage}}
 
===How To===
 
===How To===
 +
* [[/color prompt]]: show Git status in the prompt, in colors
 
* [https://ohshitgit.com/ Oh Shit, Git!?!]: solutions to frequently encountered situations in Git
 
* [https://ohshitgit.com/ Oh Shit, Git!?!]: solutions to frequently encountered situations in Git
 
* [https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ How to Rename the <code>master</code> branch to <code>main</code> in Git]: the [[GitHub]] portion of this is also doable in [[GitLab]], though the process is slightly different.
 
* [https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ How to Rename the <code>master</code> branch to <code>main</code> in Git]: the [[GitHub]] portion of this is also doable in [[GitLab]], though the process is slightly different.

Latest revision as of 22:15, 8 January 2023

About

Git is a version control system based on a powerful distributed model.

Pages

Files

Software

Error Messages

  • Error Code 403 fatal: HTTP request failed may indicate a bad password. I've found that sometimes the password either doesn't paste properly or else isn't being accepted the first time; trying again with the same password may work. (The password is not displayed, so I'm not sure which it is.)

Links

Reference

How To

Online Books

Online Courses

Articles

Discussion