NOTE
git config --global user.name saif
git config --global user.email dronespictur111@gmail.com
git config --list
ls -a
git init
ll
ls -a
cd .git/
ls -a
cd..
git commit
// in linux
touch firstfile.txt
// open and add text to here. This is my first file and save it.
git status
git add firstfile.txt
git status
git commit -m "commiting my first file to git."
git diff
// nothing is different
// open file and add another line call :second line:
git status
git add firstfile.txt
// git add 1.txt 2.txt as like that
git status
// modified file added
git commit -m "commiting my first file to git second time."
touch secondfile.txt
// second file create and put some data as this is second file. firstfile some data add
git status
git add .
// more files are added
git status
git commit -m "commiting second file as well as first file."
git status
git status
// identify and track
git log
// lifo format
git log --author="saif"
//filterd by saif author
-------------------------------------------
after commit,
git diff
.. compare previous file with new file content
a/firstfile -> staging area and in first file lines in white color
b/firstfile -> working dir and green lines new commited lines
git diff <filename>
git diff olderCommitVersion latestCommitVersion
git diff olderCommitVersion latestCommitVersion > differenceLogFile.txt
======-rename moving-------
// differenceLogFile rename as version.log.txt file from window
git mv oldName.txt newName.txt
// gitk.cache remember all this changes
//File commit history
git log
gitk <filename>
//show graphucal
// git gui open . Do r8 click and open.
gitk --follow filename
// all the details.even after renaming,
// ignore file
// project/firstfile/.git/info/
vi exclude
ls -la
cp exclude exclude_vackup
echo version.log >>exclude
cat exclude
// local file ignore
// global file ignore
touch .gitignore
#ignore all file under user folder globally.
!/ buy accept it
git add <file>
git commit -m "commit"
git push
// REMOVE file
git rm <filename>
git rm -r <folder_name>
git rm -cached <filename>
git stash
git stash save "message"
git stash -u
git stash pop
git stash list
git stash clear
git stash drop <stash>
//Git Alias
Git config --global alias.co checkout
co = checkout
br =branch
ci = commit
st = status
https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication
Create an account in GitHub
Create a remote repo
Pull source code from Remote repo to local system
Create a file called “FirstPush.txt” and upload the file from local system to Remote repo
Create a branch called “Team-A”
Add a file called “Feature-A.txt” to Team-A branch.
Push the newly created file to Branch-A.
Comments
Post a Comment