Skip to content

Latest commit

 

History

History
94 lines (65 loc) · 1.27 KB

README.md

File metadata and controls

94 lines (65 loc) · 1.27 KB

Requirements

  1. Git: Windows
  2. VsCode

Initialization

$ git init
# $ rm -rf .git; ls -a

Help

$ git --help

Commit message

$ git add .
$ git commit -m "Inital commit."

Fetch from remote repository

$ git fetch --all

fast-forward a branch

$ git merge --ff-only origin/master

Pull from remote repository

$ git pull [<remote repo>]

Push to remote repository

$ git push
To push the current branch and set the remote as upstream, use
$ git push --set-upstream origin main

Stash the changes

$ git stash
$ git stash pop
$ git stash list

alt text

Create a new branch & Switch between branch

$ git checkout -b new_feature
$ git checkout main

For more info refer here


Merge branch A into B

$ git checkout main
$ git merge emergency-fix

Rebase branch A into B

$ git checkout experiment
$ git rebase master

Cherry Pick a commit

$ git cherry-pick <commit_SHA>

// this is a new line // other line