Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nshiva/a1168f898dd0faa52272e9c7eadb0670 to your computer and use it in GitHub Desktop.
Save nshiva/a1168f898dd0faa52272e9c7eadb0670 to your computer and use it in GitHub Desktop.
GIT Introduction

What is GIT

It is a version control system which can track changes in files and coordinating work on those files among multiple people

clone a repository:

Using HTTP web url:

git clone https://github.com/vjnan369/tokboxapp.git

using SSH key:

git clone [email protected]:vjnan369/tokboxapp.git

add new remote

git remote add upstream [email protected]:vjnan369/tokboxapp.git

check remote path

git remote -v

remove remote path

git remote rm upstream

add file to git

git add . //will add all untracked files to git

commit code

git commit -m "commit text here" 

push code

git push upstream master

pull code

git pull upstream master

create a new branch

git checkout -b shiva_dev

stash the changes

git stash

get stashed data

git stash apply

check git status

git status

check changes in git

git diff

switch branch

git checkout mahesh_dev

merge other branch code into current branch

git merge shiva_dev 

look stash list

git stash list

look latest stash changes

git stash show -p

look specific stash changes

git stash show -p stash@{5}    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment