Skip to content

Instantly share code, notes, and snippets.

@viswanath11
viswanath11 / GIT commands.md
Created October 24, 2019 02:18 — forked from ThomasTJdev/GIT commands.md
GIT commands

Fix last commit message

Made a typo or wrong description in a commit message? Run and edit:

git commit --amend

Add a file to latest commit

git commit --amend --reuse-message HEAD
#or
@viswanath11
viswanath11 / git-commands
Created October 24, 2019 02:13 — forked from silversonicaxel/git-commands
GIT #git #gitflow
> the installed direction of my git
$ which git
> version of git
$ git --version
> Ignore list is a file in the base folder
.gitignore
@viswanath11
viswanath11 / git.md
Created October 23, 2019 15:36 — forked from HendrixString/git.md
git cheat sheet

account

setup name and email
for a specific repository, navigate into it and type
git config user.name "your username"
git config user.email "[email protected]"
note add --global to make it global for new repositories

change your editor for commits
git config --global core.editor "pico"
get the remote repository url

@viswanath11
viswanath11 / git.howto.md
Created October 23, 2019 15:31 — forked from epcim/git.howto.md
git howto usage guide

Various GIT usage tutorials/examples

Configuration

git config core.trustctime false
git core.filemode false

git config user.name "Alice Bob"
git config user.email [email protected]
@viswanath11
viswanath11 / Git Workflow.md
Created October 23, 2019 15:27 — forked from Integralist/Git Workflow.md
Git Workflow

Git/Github step-by-step Workflow

Step-by-step guide for creating a feature or bugfix branch, submit it for code review as a pull request and once approved, merge upstream. This guide is intended for internal developers with push access to all relevant repos.

You should understand rebasing and squashing. For a very good explanation on rebasing and squashing with pull requests see How to Rebase a Pull Request. Also worth reading is the Hacker's Guide to Git.

Setup

git fetch
git rebase origin/master
#Source: http://stackoverflow.com/questions/7200614/how-to-merge-remote-master-to-local-branch
#git merge branchname takes new commits from the branch branchname, and adds them to the current branch. If necessary, it automatically adds a "Merge" commit on top.
#git rebase branchname takes new commits from the branch branchname, and inserts them "under" your changes. More precisely, it modifies the history of the current branch such that it is based on the tip of branchname, with any changes you made on top of that.
@viswanath11
viswanath11 / gist:04eb5f5ad63dde27498f67a1c4e71674
Created October 23, 2019 15:17 — forked from alexzhernovyi/gist:bc196370a1d2b754d19589431d8723a1
Differences between git merge and git rebase

Merge IS:

• git merge apply all unique commits from branch A into branch B in one commit with final result • git merge doesn’t rewrite commit history, just adds one new commit

Rebase is:

• git rebase gets all unique commits from both branches and applies them one by one • git rebase rewrites commit history but doesn’t create extra commit for merging

Differences between git merge and git rebase

@viswanath11
viswanath11 / gitcreate.sh
Created October 2, 2019 04:10 — forked from robwierzbowski/gitcreate.sh
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)
@viswanath11
viswanath11 / README.md
Created July 24, 2019 09:49 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.