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
- Host: GitHub
- URL: https://github.com/salman-ahamed/fundamental-git-and-github-commands
- Owner: Salman-Ahamed
- Created: 2024-09-11T12:24:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-21T07:28:02.000Z (over 1 year ago)
- Last Synced: 2025-03-25T23:41:45.782Z (over 1 year ago)
- Topics: git, github, github-actions
- Homepage:
- Size: 3.91 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```