Saturday, August 2, 2014

Starting with GIT

Initializing giti init To initialize a Git repository
Checking the Status git status git status command to see what the current state of our project is
Adding git status
Git add octocat.txt
To check and add a file to git tracking mechanism.
Committing git commit -m “Add cute octocat story”
Adding All Changes git add '*.txt' Adding all *.txt files alone
Committing all git commit -m “Add all the octocat files” Now committing them.
History git log
Remote Repositories git remote add origin To push the changes of local repo to the server
Pushing Remotely git push -u origin master The -u is to remember origin and master, next time we can just do git push
Pulling Remotely git pull origin master
Difference git diff HEAD
Difference git add octocat/octodot.txt
Staged Difference git diff –staged
Resetting the Stage git reset ocotfamily/octodog.txt

git checkout – octodog.txt
Branching Out git branch clean_up

git checkout clean_up
Removing All The Things git rm '*.txt'

git commit -m “Remove all the cats”

git checkout master

git merge clean_up
Keeping things clean git branch -d clean_up Deleting the branch clean_up

git push

No comments:

Post a Comment