Skip to content

Instantly share code, notes, and snippets.

View moloccoGymondo's full-sized avatar

Matias Olocco moloccoGymondo

View GitHub Profile
git fetch origin
git reset --hard origin/branch_name
@moloccoGymondo
moloccoGymondo / builders.kt
Created February 15, 2018 14:49
Builders and data classes in kotlin
data class Car(
val model: String?,
val year: Int?,
val required: String?
) {
private constructor(builder: Builder) : this(builder.model, builder.year, builder.required)
companion object {
inline fun build(block: Builder.() -> Unit) = Builder().apply(block).build()
@moloccoGymondo
moloccoGymondo / rename_branch
Created February 7, 2018 10:39
Rename branch
git branch -m old-name new-name # Rename your local branch.
git push origin :old-name new-name # Delete the old-name remote branch and push the new-name local branch.
# Switch to the branch (if you are not there)
git push origin -u new-name # Reset the upstream branch for the new-name local branch.