Getting Started Flashcards
Still on "Undoing changes"
Create a new repository in the current directory
git init
Create an empty repository in a new directory
git init
Initialize an empty Git repository in a new folder, but omit the working directory.
git init –bare
Clone a specific git repository to the current directory
git clone
Clone a specific git repository to a specified local directory
git clone
Define the author name to be used for all commits in the current repository
git config –global user.name
Typically, you’ll want to use the –global flag to set configuration options for the current user
Define the author email to be used for all commits by the current user.
git config –global user.email
Create a shortcut for a Git command.
git config –global alias.
Define the text editor used by commands like git commit for all users on the current machine
git config –system core.editor
The argument should be the command that launches the desired editor (e.g., vi).
Open the global configuration file in a text editor for manual editing
git config –global –edit
Stage all changes in for the next commit.
git add
Stage all changes in for the next commit.
git add
Begin an interactive staging session that lets you choose portions of a file to add to the next commit.
git add -p
This will present you with a chunk of changes and prompt you for a command. Use y to stage the chunk, n to ignore the chunk, s to split it into smaller chunks, e to manually edit the chunk, and q to exit.
Create an initial commit of the current directory
git add .
git commit
Add a file to the repository and commit the addition
git add hello.py
git commit