From e29fcc6e8b9b47fca00e072b503eabd1ed718828 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Sat, 6 Feb 2021 22:10:48 +0100 Subject: [PATCH] Fix line endings and links --- Git/git.md | 70 ++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/Git/git.md b/Git/git.md index d4220cb..fac8f4f 100644 --- a/Git/git.md +++ b/Git/git.md @@ -96,40 +96,40 @@ def load_reference(name_or_id): ### Making Changes -`git status`: shows the status of changes as untracked, modified, or staged -`git add `: add files to the staging area -`git add -p `: interacively stage chuncks of a file +`git status`: shows the status of changes as untracked, modified, or staged +`git add `: add files to the staging area +`git add -p `: interacively stage chuncks of a file -`git stash`: temporarily remove modifications to working directory (must be staged to be stashed) -`git stash pop`: recuperate stashed changes +`git stash`: temporarily remove modifications to working directory (must be staged to be stashed) +`git stash pop`: recuperate stashed changes -`git blame `: show who last edited which line +`git blame `: show who last edited which line `git commit`: save the snapshot to the project history `git commit -m "message"`: commit and provide a message `git commit -a`: automatically notice any modified (but not new) files and commit -`git diff `: show difference since the last commit -`git diff `: show differences in a file since a particular snapshot -`git diff `: show differences in a file between two snapshots +`git diff `: show difference since the last commit +`git diff `: show differences in a file since a particular snapshot +`git diff `: show differences in a file between two snapshots `git diff --cached`: show what is about to be committed -`git diff ...`: show content diff between two branches +`git diff ...`: show content diff between two branches -`git bisect`: binary search history (e.g. for regressions) +`git bisect`: binary search history (e.g. for regressions) ### Remotes -`git remote`: list remotes -`git remote -v`: list remotes names and URLs +`git remote`: list remotes +`git remote -v`: list remotes names and URLs `git remote show `: inspect the remote -`git remote add `: add a remote +`git remote add `: add a remote `git branch --set-upstream-to=/`: set up correspondence between local and remote branch -`git push `: send objects to remote +`git push `: send objects to remote `git push :`: send objects to remote, and update remote reference -`git fetch []`: retrieve objects/references from a remote +`git fetch []`: retrieve objects/references from a remote `git pull`: update the local branch with updates from its remote counterpart, same as `git fetch; git merge` `git fetch && git show /`: show incoming changes @@ -137,7 +137,7 @@ def load_reference(name_or_id): `git clone []`: download repository and repo history from remote `git clone --shallow`: clone only repo files, not history of commits -`git remote remove `: remove the specified remote +`git remote remove `: remove the specified remote `git remote rename `: rename a remote ### Viewing Project History @@ -150,32 +150,32 @@ def load_reference(name_or_id): `git log --oneline`: compact log `git show `: output metadata and content changes of commit -`git cat-file -p `: output commit metadata +`git cat-file -p `: output commit metadata ### Tag -Git supports two types of tags: *lightweight* and *annotated*. +Git supports two types of tags: *lightweight* and *annotated*. -A lightweight tag is very much like a branch that doesn’t change—it’s just a pointer to a specific commit. +A lightweight tag is very much like a branch that doesn’t change—it’s just a pointer to a specific commit. -Annotated tags, however, are stored as full objects in the Git database. -They’re checksummed;contain the tagger name, email, and date; have a tagging message; and can be signed and verifiedwith GNU Privacy Guard (GPG). -It’s generally recommended creating annotated tags so it's possible to have all this information. +Annotated tags, however, are stored as full objects in the Git database. +They’re checksummed;contain the tagger name, email, and date; have a tagging message; and can be signed and verifiedwith GNU Privacy Guard (GPG). +It’s generally recommended creating annotated tags so it's possible to have all this information. -`git tag`: list existing tags -`git tag -l|--list `: list existing tags mathcing a wildard or pattern +`git tag`: list existing tags +`git tag -l|--list `: list existing tags mathcing a wildard or pattern -`git tag []`: create a *lightweight* tag on the commit -`git tag -a [ -m ]`: create am *annotated* tag on the commit +`git tag []`: create a *lightweight* tag on the commit +`git tag -a [ -m ]`: create am *annotated* tag on the commit -`git push `: push a tag to the remote -`git push --tags`: push commits and their tags (both types) to the remote +`git push `: push a tag to the remote +`git push --tags`: push commits and their tags (both types) to the remote -`git tag -d `: delete a tag -`git push :refs/tags:`: remove a tag from the remote -`git push --delete `: remove a tag from the remote +`git tag -d `: delete a tag +`git push :refs/tags:`: remove a tag from the remote +`git push --delete `: remove a tag from the remote -`git checkout `: checkout a tag - **WARNING**: will go into *detached HEAD* +`git checkout `: checkout a tag - **WARNING**: will go into *detached HEAD* ### Branching And Merging @@ -241,9 +241,7 @@ git checkout # checkout remote branch (omit /) git pull # clone branch ``` -### [Sync Forks][github sync frok guide] - -[github sync frok guide](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) +### [Sync Forks](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) ```ps1 git fetch upstream # Fetch the branches and their respective commits from the upstream repository