Git basic commands

To view the git config settings

1) git config –list
2) git config user.name

Initializing a git repository and adding files
git init
git add .
git commit -m “comments”

Git pushing changes to an existing repository:
git remote add origin URL_OF_GIT_REPOSITORY
git push -u origin master

git log
git pull –rebase
git stash
git status

 

git discard all local changes/commits and pull from upstream

git reset --hard origin/master

git pull origin master

 

Tutorial : http://rogerdudler.github.io/git-guide/, http://kbroman.org/github_tutorial/pages/fork.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s