diff --git a/Git/git.md b/Git/git.md index f7b42d5..defa264 100644 --- a/Git/git.md +++ b/Git/git.md @@ -96,9 +96,9 @@ 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 blame `: show who last edited which line @@ -106,13 +106,13 @@ def load_reference(name_or_id): `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) ### Stashes @@ -125,17 +125,17 @@ def load_reference(name_or_id): ### 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 @@ -143,7 +143,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 @@ -156,32 +156,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 @@ -247,9 +247,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