Skip to content

About

assignment 3.1 cohort 7

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

github-3.1-shafiq

assignment 3.1 cohort 7

Image description

GitHub Commands for Version Control

This README provides a summary of some essential GitHub commands for version control.

1. Git Basics

  • 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.

2. Collaboration and Remote Repositories

  • 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 main branch. Replace origin with 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.

3. Additional Commands

  • 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 main branch 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.

About

assignment 3.1 cohort 7

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors