git basic command code example
Example 1: git basic command tutorial
cd my_awesome_project
git init
git config --global user.name POG
git config --global user.email [email protected]
git add .
git commit -m "Create REAME and gitignore"
Example 2: Common GIt Commands
git init
//add all
git add .
//cancel adds
git reset
//cancel commits
git reset HEAD^
//cancel last 3 commits
git reset HEAD~3
//when first commit
git push -u origin master
//remove remote origin
git remote remove origin
//reset remote origin
git remote add origin https://github.com/yourname/project.git
Example 3: git basic commands
git push origin <branchname>
Example 4: git basic commands
git checkout <branchname>