Skip to content

Latest commit

 

History

History
77 lines (45 loc) · 1.36 KB

File metadata and controls

77 lines (45 loc) · 1.36 KB

Version Control

Practicing various git command and their executions

Creating a Repository

  • created on my GitHub account

Cloning a Repository

Create new-branch

  • git branch
  • git branch Smitho

Change to new-branch

  • git checkout
  • git checkout Smitho

Committing Changes

  • git add or git add .
  • git add .

Adding Commit message

  • git commit -m 'initial commit'
  • git commit -m ""

Reverting Commits

  • git revert
  • git revert commit - git log --oneline | -git revert
  • quit editor - q | - git push

Pulling Changes (Downstream and Upstream)

  • git pull
  • git pull Version-Control-Repo main

Pushing Changes (Downstream and Upstream)

  • git push
  • git push Version-Control-Repo main

Fetching Changes

  • git fetch
  • git fetch Version-Control-Repo

Merging Branches

  • git merge
  • git merge Smitho

Renaming Branches

  • git branch -m
  • git branch -m Smitho
  • git push origin -u Smitho

Creating Pull Requests

  • pull request was created and done on the github repository online.

Reverting Pull Requests

  • git log
  • git revert