Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

github command

# Main git commands

# Configurations

git config --global user.name "Sam Smith"
git config --global user.email sam@example.com

# New Repository

git init

# Copy local repository

git clone /path/to/repository 

# Copy local repository for remote servers

git clone username@host:/path/to/repository

# Add files

git add <filename>

git add *

# Git Commits

git commit -m "Commit message"

# Commit any files added with git add command

git commit -a

# Push changes to master branch

git push origin master

# Check the status of files

git status

# Connect to remote repository

git remote add origin <server>

# Provide a list of recently configured remote repositories

git remote -v

# Create new branch then switch to it

git checkout -b <branchname>

# Switch branches

git checkout <branchname>

#List all branches in repository

git branch

# Delete the feature branch 

git branch -d <branchname>

# Push selected branch to your remote repository

git push origin <branchname>

# Push all branches to remote repository

git push --all origin

# Delete a branch on the remote repository

git push origin :<branchname>

# Fetch and merge changes on remote server to certain directory

git pull

# Merge a different branch into active branch

git merge <branchname>

# View merge conflicts

git diff

git diff --base <filename>

git diff <sourcebranch> <targetbranch>

# Mark changed file

git add <filename>

# Utilise tagging to mark a certain changeset

git tag 1.0.0 <commitID>

# Get changeset ID

git log

# Push all tags to remote repository

git push --tags origin

# Undo local changes, replace changes

git checkout -- <filename>

# Drop all changes and commits

git fetch origin

git reset --hard origin/master

# Search the working directory for foo(); (example)

git grep "foo()"
Comment

github commands

github all commonly used command sheet  
Comment

Basic git / github commands

gst - git status
gc  - git commit
gaa - git add --all
gco - git checkout
gp  - git push
gl  - git pull
gcb - git checkout -b
gm  - git merge
grb - git rebase
gpsup - git push --set-upstream origin $(current_branch)
gbda  - git branch --no-color --merged | command grep -vE "^(+|*|s*(master|develop|dev)s*$)" | command xargs -n 1 git branch -d
gfa - git fetch --all --prune
Comment

PREVIOUS NEXT
Code Example
Shell :: linux compress a pdf 
Shell :: move a file from one directory to another in linux 
Shell :: install choco 
Shell :: how to install gitlab on mac os 
Shell :: pyglet linux 
Shell :: curl powershell post example 
Shell :: for in shell script 
Shell :: dlib installation 
Shell :: how to assign a value to a variable in batch script using powershell 
Shell :: github merge conflict 
Shell :: how to compare a character to uppercase in bash script 
Shell :: bokeh install 
Shell :: bash functions 
Shell :: installing docker compose on ec2 
Shell :: slack powershell command 
Shell :: shreck 
Shell :: how to convert vdi to gnome boxes 
Shell :: untar 
Shell :: github shows two icons on commit 
Php :: php check folder exists and create 
Php :: phpmailer utf8 
Php :: var_dump smarty 
Php :: get start of month end of month carbon 
Php :: wordpress turn off php warnings 
Php :: php hide notice 
Php :: laravel catch exception ex log save 
Php :: laravel storage hard link 
Php :: migrate single file in laravel 
Php :: php version 
Php :: prepend 0 to number php 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =