Skip to content

Instantly share code, notes, and snippets.

@guimaluf
Last active July 3, 2019 11:54
Show Gist options
  • Save guimaluf/6f9ac97ccc0a05f327e959d479eccd23 to your computer and use it in GitHub Desktop.
Save guimaluf/6f9ac97ccc0a05f327e959d479eccd23 to your computer and use it in GitHub Desktop.
Simple beginner to master git workflow; Simple mastering git

git Workflow

git is a wonderful SCM, so is extremely important know about its right use. Spent some time reading the articles below contributes to a good code repository.

I know nothing about git

Start with github code school where you'll learn the basics commands for using git. If you want to understand in detail what each commands does read the official documentation

I'm used to git, but the only branch I know is master

If you're not used to work with other or if you only use the master branch, checkout this git workflow, this is how we should work. When you understood how to work with branches checkout how to make them an ally in your delevopment

I'm the new git grand master, but I'm using commit messages like this

A good commit message should be self explanatory, it should describe the problem been solved and how it was solved. It's very important write good messages, so the history is human readable and doesn't requires code digging. Read this and click here if you want to know what a big opensource project recommends in terms of commit messages.

Quick command reference

Remember to change parameters. Values listed here are just examples.

FORMATTING GIT

https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

Remote repos

List remote repos URL:

git config --get remote.origin.url

Add a remote repos, list all remotes and fetch (update) branch list: git remote add ophidia https://github.com/OphidiaBigData/ophidia-analytics-framework.git git remote -v git fetch ophidia

To see the list of branches: git branch -a

Applying changes from one remote branch to local branch

Suppose devel is the development branch and ophidia is a remote repos and has a branch also named devel:

git checkout devel
git pull ophidia devel
git push # send to remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment