git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
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
git clone "your repo link"
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.
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.
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
On Windows (using PowerShell)
Remove-Item .git -Recurse -Force
On Windows (using Command Prompt)
rmdir /s .git
On Unix/Linux/Mac:
rm -rf .git