https://github.com/yoursandeshshrestha/git-github
This repo guide begginer on how to use git and github, also provides important Git and GitHub commands for all users. ✨
https://github.com/yoursandeshshrestha/git-github
git gitcommands github github-config githubcommands gudietogit guidetogithub
Last synced: 9 months ago
JSON representation
This repo guide begginer on how to use git and github, also provides important Git and GitHub commands for all users. ✨
- Host: GitHub
- URL: https://github.com/yoursandeshshrestha/git-github
- Owner: yoursandeshshrestha
- Created: 2024-03-29T06:10:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-25T16:00:24.000Z (over 1 year ago)
- Last Synced: 2024-04-25T17:26:18.813Z (over 1 year ago)
- Topics: git, gitcommands, github, github-config, githubcommands, gudietogit, guidetogithub
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git & GitHub 😺
## How to setup git 🚀
## Configure Git: 😇
* `git config --global user.name "Your Name"`
* `git config --global user.email "youremail@example.com"`
## Connecting and pushing repo to github 🛠️
* `git init`
* `git add README`
* `git commit -m "first commit'`
* `git branch -M main`
* `git remote add origin "your repo link"`
* `git push -u origin main`
## Cloning a repo into local 👬
* `git clone "your repo link"`
## Most Important Git Commands: ⭐
**git init:** `Initializes a new Git repository in the current directory.`
**git clone [url]:** `Clones a remote repository to your local machine.`
**git add [file]:** `Adds a file or changes in a file to the staging area.`
**git commit -m "message":** `Commits staged changes with a descriptive message.`
**git status:** `Shows the status of your working directory and staging area.`
**git diff:** `Shows the differences between the working directory and the staging area.`
**git log:** `Displays the commit history.`
**git branch [branch_name]:** `Creates a new branch or lists existing branches.`
**git checkout [branch_name]:** `Switches to the specified branch.`
**git merge [branch_name]:** `Merges changes from the specified branch into the current branch.`
**git pull:** `Fetches changes from the remote repository and merges them into the current branch.`
**git push:** `Pushes committed changes to the remote repository.`
## Most Important GitHub Commands: ⭐
**git remote add origin [url]:** `Connects your local repository to a remote repository on GitHub.`
**git push -u origin [branch_name]:** `Pushes the specified branch to GitHub, establishing a tracking relationship.`
**git pull origin [branch_name]:** `Pulls changes from a remote repository on GitHub into your local repository.`
**git fetch:** `Fetches changes from the remote repository on GitHub without merging them into your local branch.`
**git clone [url]:** `Clones a repository from GitHub to your local machine.`
**git fork:** `Forks a repository on GitHub, creating a copy under your account.`
**git pull-request:** `Opens a pull request on GitHub, allowing you to propose changes to a repository.`
**git issue:** `Manages issues on GitHub repositories.`
**git blame [file]:** `Shows who last modified each line of a file and in which commit.`
**git tag [tag_name]:** `Tags a specific commit in your repository.`
## My personal steps to clone github repo into my local storage 🔖
* `cd desktop`
* `git clone [Repo Link]`
* `cd [project name]`
* `git init`
* `git add . (. <- basically add all file) or you can upload any single file. for example index.html`
* `git commit -m "Added html file" (this is message u upload while pushing commit)`
* `git push`
## Remove Git from folder 🗑
**On Windows (using PowerShell)**
* `Remove-Item .git -Recurse -Force`
**On Windows (using Command Prompt)**
* `rmdir /s .git`
**On Unix/Linux/Mac:**
* `rm -rf .git`