Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
GITHUB COMMANDS
ls -la List hidden files
ls - lrta List hidden files with the timestamp in reverse order
git init Initialize git, create local repository,
worling directory and create .git folder git add filename Track the untracked file git status To check file status git rm -- cached <file> Remove cache from stagging area to working directory git config --global user.name {“your To set username to identify who name”} made changes. git commit(save) –m “my first Move file from staging area to local commit” repo git commit -am Commit the latest changes without using add command every time after time used add command git log To check log Git log --oneline Show log in oneline git remote add origin <github Url> Adding remote system(physical system) github url git push –u origin master Push files from git to github git branch To check no of branches git branch <dev> Creating new branch git branch -d <dev> Deleting a branch locally git checkout <master> Moving from one branch to another git merge <dev> Merge feature branch with master branch git config --global core.editor vim Tools used to resolve merge conflicts{to solve conflict we must be in master branch} git config --global core.compression 2 git config --global diff.tool vimdiff3 git rebase To avoid merge conflicts and used to upload both files which is correct and which was created by diff person for same task.{to perform rebase we must be in feature branch } git cherry-pick <commit-ID> Picking specific commit from one branch to another git stash Uncommitted files are stored in temporary storage git stash list To view stashed file git stash apply To recover the stashed file from temp storage git fetch download commit from remote repo to local system. git pull download and update the commits from remote repo to local system git clone <repo https URL> copy whole repo within same system git fork Copy whole repo between different github account git branch –m <old -name> <new Rename the branch name>