sudo apt install gh git

Login via (just follow the prompts)

gh auth login

Config username and email: → remove –global option to just configure the login for one specific repository/directory

git config --global "<email-address>"
git config --global "<github-username>"

Replace email-address with your GitHub email and github-username with your username.

Change to the highest directory of your project, then intialize repository:

git init

Add the remote:

git remote add origin '<url>'

In case of GitHub <url> for example can be<username>/<repository>/.

Add files to commit:

git add /path/to/file(s)

View status of changes:

git status

Before starting to edit, sync external changes*:

git fetch <remote-repo>
git pull origin <branch>

Create commit:

git commit -m <message>

Push changes*:

git push origin <branch>

*Replace branch with the concerning branch, e.g. main.


git merge


git rebase


Sourced from: - git merge & git rebase

  • linux/command-collection/git.txt
  • Last modified: 2024/03/03 00:05
  • by Zyzonix