Git Codes
A for config name, Emails :
git config --global user.name Suppandi
git config --global user.email De............u@gmail.com
B for checking email, name:
git config --global user.email
git config --global user.name
for ignoring files
add them to .gitignore folder
for ignoring extention
add *.extention
*.c
C more codes
code . opening vs code
- code .
- git init for initiliase
- ls -lart show all folders
- git status show file status
- git add file.c for adding a file named file.c
- git commit for commiting a git , message will be added in vim editor later
- git commit -m "message" for commiting with message
- touch newfile.cpp for adding new blank file name newfile.cpp(with extention)
- git add -A for adding all untracked file to staged area
- clear for clearing terminal
- git checkout file.c get back to initail staged position to last commit for file.c
- git checkout -f get back to all modifed file to last commit
- git log tell what you have commited
- git log -p -n to see last n commit n is numerical
- git diff compare working tree with staging area
- git diff --staged comparing current commit to just before commit
- git commit -a -m "message" adding and commit together
- git rm --cached newfile.cpp removing newfile.cpp form tracked ie shifting to untracked
- git rm newfile.cpp removing then deleting newfile.cpp
- q exit log
- git status -s seeing only current wprking file status
- git clone to clone a repo in new directory
- git restore restore working tree files
- git mv move or rename a file or directory
- git bisect use search to find the commit that introduce a bug
- git grep print lines matching a pattern
- git show show various type of objects
- git merge br.name to merge br.name branch to current one (both must be at fully commit state)
- git branch --delete br.name to delete branch br.name
- git branch -D br.name to deleat branch br.name even if not completely merrged
- we run cat ...... command t\for details of ssh key (the deploy it to add one
- git remote add upstream url for featching others updates
- git remote remove nameofrem removing remote
- git remote -v for checking remotes
- git checkout -b branch _nme adding new branch and going int it as well
- git rm file-path : deleating a file whose path (including it) is "filepath"
- gcc file.name -o file : will creat a exe file of file.name by name of"file"
- git push origin master -u : for making push as default
- git pull origin master : for pulling master barnch from origin to current branch
Comments
Post a Comment