// see what's in staging area // it can also help to see which file has been modified after last commit git status
// add file to staging area git add chapter1.txt git add .
// remove from staging area git rm --cached -r filename
// commit the files git commit -m "test"
// see what's been commited git log
// compare the difference between working area and local repostory git diff filename
// roll back to the previous version that was committed in our local repository git checkout chapter3.txt
Remote Repository
1 2 3 4 5 6 7
// create the remote git remote add origin https://github.com/DanLovPotato/Test.git
//push local repository to remote repository // u option is to link up your remote and local repositories // origin is the name of remote and master is the name of branch git push -u origin master
Git Ignore(do this before git add)
1 2 3 4 5 6 7 8
touch .gitignore// you put the file names that you dont want to upload in here
in gitignore:
secrets.txt (filename) # comment (comment) *.txt (all the txt file wont be uploaded)