Skip to content

Instantly share code, notes, and snippets.

@Atulin
Last active May 30, 2021 11:18
Show Gist options
  • Save Atulin/58b207d4f74ea31e8a95294f77da0eb5 to your computer and use it in GitHub Desktop.
Save Atulin/58b207d4f74ea31e8a95294f77da0eb5 to your computer and use it in GitHub Desktop.
Gitting started with Git

First, install Git from here.

Command Description
git init Initialize a repository in the current directory
git add . Start tracking all non-ignored files
git commit -m "message" Create a commit with a given message
git remote add origin [url] Add the remore repo with the [url] as the origin.
git push -u origin master First push to the remote repo, the origin branch. Sets the origin branch as the upstream for local master at the same time.
git push after the upstream is set, all further pushes are as simple as this

Congratulations! Your code is now version-controlled and backed up to the remore server!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment