quinta-feira, 2 de abril de 2015

Git - Quick reference

This is a list of links and quick reference for common tasks I need to do frequently using Git and GitHub.

 Git Hub quick start basic reference site I like with tips for creating and starting a git repo: http://rogerdudler.github.io/git-guide/

 How to fork from GitHub and keep forked repo in sycn with original: https://help.github.com/articles/fork-a-repo/

 If original repo from where you forked from has changes and you need to sync your fork: https://help.github.com/articles/syncing-a-fork/

 Good easy reference for forking, branching, etc: https://gun.io/blog/how-to-github-fork-branch-and-pull-request/

 Basic list of commands:

 Starting a repo: Create a directory and type: git init

 Committing changes(local repo only): git commit -m "commit message here"

Check current working branch: git status
Create a branch and check out to it: git checkout -b $branchName
Switch back to main or other branch: git checkout $branchName
Push branch to remote repo:  git push origin $branchName

View log history: git log
Create a tag: git tag $tagName  $commitIdFromGitLog
Push tag to remote repo: git push --tags OR git push origin $tagName

Delete a remote branch locally: git branch -rd origin/$branchName
Than delete it in the remote repo: git push origin --delete $branchName

 This is a work in progress... To be continued...

Nenhum comentário:

Postar um comentário