Skip to content

Dheeraj26-02/Git_Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 

Repository files navigation

Commands

git init --> initialization
git remote add origin url-name --> connect repo with vscode
git remote -v -->verify remote
git branch -->to check branch
git branch -M main --> renaming default branch as main
git add . --> adding file
git commit -m "comment" -->commit all files(green)
git status -->checking commited file
git push -u origin main -->pushing to remote repo(next push--> git push)

Branching

git checkout -b branch-name -->to create new branch
git branch -d branch-name -->to delete branch
git diff branch-name --> to compare two branches
git pull origin branch-name -->pulling from remote repo
git merge branch-name -->merge two branches if there is no conflicts(change in same line)

Undoing changes

git reset file-name --> undo last commit
git reset head~1 --> commit goes back one step
git reset commit-hash --> go back to specific commit
git reset --hard commit-hash --> changes are done vscode also

Cloning

git clone -->copying repo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors