assignment 3.1 cohort 7
This README provides a summary of some essential GitHub commands for version control.
-
git init: Initializes a new Git repository in your local directory.
-
git add or git add . (dot): Adds files to the staging area for the next commit.
-
git commit -m "": Creates a commit with a descriptive message to record changes to the repository.
-
git status: Shows the current status of your working directory, including untracked and staged files.
-
git remote add : Adds a remote repository (e.g., your GitHub repository) to your local one. Replace
<name>with a chosen nickname and<url>with the actual URL of your GitHub repository. -
git push -u origin main: Pushes your local commits to the remote repository's
mainbranch. Replaceoriginwith the remote nickname you used in the previous command. -
git clone : Clones (downloads) a remote repository to your local machine. Replace
<url>with the URL of the repository you want to clone.
-
git branch <branch_name>: Creates a new branch.
-
git checkout <branch_name>: Switches to an existing branch.
-
git merge <branch_name>: Merges a branch into the current branch.
-
git pull origin main: Fetches changes from the remote
mainbranch and integrates them into your local branch. -
git log: Shows the commit history of your repository.
Note: Refer to the official GitHub documentation (https://docs.github.com/en) for detailed explanations and usage examples of these commands.
