diagnostics_cheat_sheets/cheat-sheets/git-and-github-cheat-sheet.adoc
hhftechnologies ccdfb79a59 update
2024-10-01 11:45:28 +05:30

53 lines
1.7 KiB
Text

= Git and github.com cheat sheet
:author: Yuri Slobodyanyuk
Author: Yuri Slobodyanyuk, https://www.linkedin.com/in/yurislobodyanyuk/
[cols=2,options="header"]
|===
|command
|Description
|*git clone <URL of the remote repository> [local repo name]*
| Clone remote repository, optionally renaming the local copy of it.
|*git config --system <params>*
|Set configuration parameters for all users at the local host, requires root permissions, saves <params> in the `/etc/gitconfig`. Some params (when setting on the terminal, separate paramater value from name with whitespace):
- `core.editor` Editor to use to enter comments when committing. E.g. `git config --system core.editor vim`.
- `diff.tool` Diff tool to use, e.g. `vimdiff`,`vimdiff2`,`xxdiff`,`gvimdiff`
- `user.email` Email to be incldued in each commit.
- `user.name` Full name to be included in each commit.
|*git config --global <params>*
|Set <params> for ALL repositories of a user on the local host, saves <params> in the `~/.gitconfig` or `~/.config/git/config`.
|*git config --local <params>*
|(default) Set <params> for a specific repository only, should be run when inside this repository, saves <params> in the `.git/config` inside the repository.
|*git config --list --show-origin*
|View all the settings with their origins.
|*Contribute to a project (pull request/PR) on Github.com*
a| Steps to contribute to some project on the github:
. Fork the project you want to contribute to.
. Clone the fork to your local system.
. Make a new custom (non-master) branch inside it.
. Make your changes.
. Push this branch to your Github account.
. Open a Pull Request on the Github.com for the project owner to review & merge.
|===