Name: Git-CheatSheet
Owner: KJSCE Codecell
Description: null
Created: 2017-01-21 04:04:20.0
Updated: 2018-01-24 18:12:10.0
Pushed: 2017-10-12 18:04:57.0
Homepage: null
Size: 6
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
ain Distro
apt-get install git
dora Distro
-y install git
Download github desktop and shell
from here
#to initialize git in a local directory
git init
#to clone a repo from github
git clone url
#set up user name
git config --global user.name "Insert your name here"
#set up user email
git config --global user.email "Insert your email here"
git status
dd a specific file
t add filename
dd a specific file type
t add *.extention
dd all files
t add .
or
t add *
his command will unstage the files which are not commited
t reset filename
commit -m "Insert Commit message here"
ailed commit history
log
reset --hard sha
sha is the alphanumeric you find when using git log
# check current branch names
git branch
# add a new branch
git branch branchname
# switch to a different branch
git checkout branch name
# add a new branch and switch to that branch
it checkout -b branchname
merge a branch to the current branch
it merge branchname
Manage the set of repositories (“remotes”) whose branches you track.
#check available remotes
git remote
#Add a new remote
git remote add url
#pull all the branches from your main repo
git pull
#pull specific branch from a specific repo
git pull remote-name branch-name
# push all the branches to the main repo
git push
#push specific branch to a specific repo
git push remote-name branch-name