An open API service indexing awesome lists of open source software.

https://github.com/salman-ahamed/fundamental-git-and-github-commands

Fundamental Git & GitHub Commands
https://github.com/salman-ahamed/fundamental-git-and-github-commands

git github github-actions

Last synced: about 1 year ago
JSON representation

Fundamental Git & GitHub Commands

Awesome Lists containing this project

README

          

# Git-Work

## 1. Creating a New Git Repository and Pushing It to GitHub

```sh
# Initialize a new Git repository locally
git init

# Add all files in the current directory to the Git repository
git add .

# Commit the files with a message
git commit -m "Initial commit"

# Add your GitHub repository as the remote origin
git remote add origin https://github.com/your-username/your-repo-name.git

# Push the commit to the master branch (or main branch) on GitHub
git push -u origin master

```

## Pushing Changes After Each Update

```sh
# Add changes to the staging area
git add .

# Commit the changes with a message
git commit -m "Your commit message describing the change"

# Push the changes to the GitHub repository
git push

```

## Cloning a GitHub Repository

If you want to copy a remote repository to your local machine, you use the `git clone` command.

```sh
# Clone a repository from GitHub
git clone https://github.com/your-username/your-repo-name.git
```