Skip to content

EruelUrsua/Git_CheatSheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Git_CheatSheet

For complete git commands check the online documentation

[online documentation] (https://git-scm.com/docs)

Set Up Repository Commands

  1. Set Up Terminal / Bash Commands
echo "# Git_CheatSheet" >> README.md
git init
git add README.md
git commit -m "<Commit Message>"
git branch -M main
git remote add origin <Repository Link>
git push -u origin main
  1. Pushing Files Terminal / Bash Commands
git remote add origin <Repository Link>
git branch -M main
git push -u origin main
  1. Make a copy of the repository in your local machine (be sure to go to your chosen folder first)
git clone

How to Contribute

  1. Create a New Branch
git checkout -b <Branch Name>
  1. Apply changes to the code
  2. Save the changes
git add .
  1. Commit Changes
git commit -m "Add Details"
  1. Push the changes
git push origin -u <Branch Name>
  1. Go to repository
  2. Create a Pull Request then submit
  3. If there are no conflicts click merge changes

How to Update Local Machine If Repository Is Changed

  1. Switch to the Main Branch
git checkout main
  1. If you can't switch branches stash your current branch
git stash
git checkout main
  1. Pull Repository Changes
git pull
  1. Checkout to your current branch
git checkout <Branch Name>
  1. Rebase your current Branch
git rebase main
  1. If you stash your current Branch
git stash pop
  1. Double-check if your current branch contains the changes from the main branch

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published