Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fluentcodes/GitSamples-GIT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

GitSamples-GIT: Automate GIT

It could be rather boring to type some complicated git commands one use several times a day. And some of the parameters are rather unintuitive for e.g.

 git add .

which uses a "." instead of everydays "*".

Purpose of this topic branch is to develop and describe a number of everydays helper.

Aliases

All aliases starts with "g".

alias ga='git add .;'
alias gaca='ga; git commit --amend'
alias gacan='gaca --no-edit;'
alias gacap='gacan git push -f'
alias gb='git branch'
alias gba='gb --all'
alias gca='git commit --amend'
alias glo='git log --oneline'
alias gs='git status'

Methods

new

The following function alias cereats a new branch from _empty with INPUT as name and an initial commit "INPUT:init".

alias new='function _new(){git checkout _empty; git checkout -b "$1"; echo "" >> .gitignore; ga; git commit -m "$1:init"};_new'
Example
new test

Switched to branch '_empty'
Your branch is up to date with 'origin/_empty'.
Switched to a new branch 'test'
[test d5856b5] test:init
1 file changed, 1 insertion(+)
Logs
d5856b5 (HEAD -> test) test:init
4767389 (origin/_empty, _empty) empty:init

For Fun

  • alias lol='git log --oneline'

Links

About

GitSamples for GIT using Topic Branches for elementary git operation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published