Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linux:command-collection:git [2023/07/30 12:11] – ↷ Page moved from linux:command_collection:git to linux:command-collection:git Zyzonix | linux:command-collection:git [2026/06/02 08:38] (current) – removed Zyzonix | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== git (GitHub CLI) ===== | ||
| - | Packages: | ||
| - | <code bash> | ||
| - | |||
| - | ==== Configuring gh and git ==== | ||
| - | Login via (just follow the prompts) | ||
| - | <code bash>gh auth login</ | ||
| - | |||
| - | Config username and email: | ||
| - | -> remove '' | ||
| - | <code bash>git config --global user.email "< | ||
| - | <code bash>git config --global user.name "< | ||
| - | Replace '' | ||
| - | |||
| - | ==== Initialize directory for git ==== | ||
| - | Change to the highest directory of your project, then intialize repository: | ||
| - | <code bash>git init</ | ||
| - | |||
| - | Add the remote: | ||
| - | <code bash>git remote add origin '< | ||
| - | In case of GitHub ''< | ||
| - | |||
| - | ==== Pushing changes to GitHub ==== | ||
| - | Add files to commit: | ||
| - | <code bash>git add / | ||
| - | |||
| - | View status of changes: | ||
| - | <code bash>git status</ | ||
| - | |||
| - | Before starting to edit, sync external changes*****: | ||
| - | <code bash>git pull origin < | ||
| - | |||
| - | Create commit: | ||
| - | <code bash>git commit -m < | ||
| - | |||
| - | Push changes*****: | ||
| - | <code bash>git push origin < | ||
| - | |||
| - | *****Replace '' | ||
| - | |||
| - | ==== git merge and git rebase ===== | ||
| - | **Merge:** | ||
| - | <code bash>git merge</ | ||
| - | |||
| - | **Rebase:** | ||
| - | <code bash>git rebase</ | ||
| - | |||
| - | **Differences: | ||
| - | |||
| - | {{: | ||
| - | |||
| - | //Sourced from: [[https:// | ||