You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git init // In local machine from project's root folder
git add . // Add all the files in directory to local git
// Make chanegs to the source
git commit -a -m "sample message for the commit"
git remote add origin <remote repository url from github.com>
git push -u origin master // push the master branch to github.com
Create a branch, switch to it and work on it
git branch <new_branch>
git checkout <new_branch> // switch to new branch
git status - verify the current branch
// (..) compare heads of two branches
git diff branch1..branch2
// (...) compare common ancestor of two branches with head of right side branch
git diff branch1...branch2
Remove file from git
// remove from repo and disk
git rm file1.txt
git commit -m "remove file1.txt"
// remove from repo only
git rm --cached file1.txt
git commit -m "remove file1.txt"