Git

Contents
Basics
Installation
Branches
clone, remote, push, pull, github, gitlab
Error analysis
Other articles about Git
Basics
Common user commands
--version: Find out the Git version
config: Set the Git username
--local user.name: Run as a different user
init: Initialize a Git repository
status: Current state of the repository
add: Add a file to the staging area
reset: Remove a file from the staging area
restore: Remove uncommitted changes
commit: Commit changes
checkout -- . : Restore last commit
checkout .: Restore deleted file
diff: Inspect changes
.gitignore file: Ignore certain files
git hash-object
git stash
Install
Installing Git on Linux
Installing Git Bash on Windows
Installing TortoiseGit on Windows
Branches
branch: Branches
Create a new branch
checkout: Change branch
-d: Delete branch
-m: Rename branch
Update branch from remote repository
clone -b: Clone only specific branch
Remote Repo
clone: Clone a remote repository
remote, push, pull, clone,GitLab, Github …
remote -v: Check which remote repository git links a local repository to
remote add origin: Link a remote repository (first time)
remote set-url: Change the linked remote repository
push: Push new data to the remote repository
pull: Download data from the remote repository and update the local one
GitHub
GitLab
Errors
fatal: No such remote 'origin'
error: failed to push some refs to
fatal: Could not read from remote repository

Article author: Andrei Olegovich

Related articles
Git
Protecting the main branch on GitHub
Установка в Windows
Установка TortoiseGit
.gitignore
Необходимые Bash команды
Errors
Development
DevOps
SSH
Работа с API GitHub

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: