Hey everyone! This will be a short and sweet blog on git commands. Let's git started (that was cringy for me too but I couldn't resist!).
This might be the simplest command. It creates a new repo and all you have to do is type this:
git init [repository name]
This will to create a copy or "clone" of an existing repo. Just type:
git clone [url to the repo]
A handy shortcut that can be created is gcl, if you're into saving keystrokes check I'd suggest using it.
Git diff shows the differences in files that have not yet been staged. To see them, all you have to type is "git diff".
This will show you the differences in the files that have been staged.
Shows the differences between the specified branches.
This will unstage a file but keep the contents the same.
git reset [file name]
This command undoes all commits after the specified commit but changes are only saved locally.
Returns content back to the specified commit.
Will delete the file from your working directory and stages it.
git rm [file]
This command will connect your local repo to the remote server:
git remote add [variable name] [remote server link]
git remote add origin https://github.com/youracccount/repo.git
That's it for this time. Let me know what git commands you use often or think are important to know in the comments!!!