Skip to content

Instantly share code, notes, and snippets.

@Sasha-hk
Last active June 24, 2022 14:31
Show Gist options
  • Save Sasha-hk/bc76de96451928fa226aaa4d35ff31bd to your computer and use it in GitHub Desktop.
Save Sasha-hk/bc76de96451928fa226aaa4d35ff31bd to your computer and use it in GitHub Desktop.

Git tutorial

Create repository

Create repository:

git init

See files:

git status

Add files to commit:

git add .

or

git add filename.txt

Commit files:

git commit -m "commit name"

Work with remote

Add remote:

git remote add origin https://github.com/....

Push changes to remote:

git push origin main

Other useful commands

See branches:

git branch

Change branch:

git checkout branch_name

Create branch:

git checkout -b branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment