commands

PHOTO EMBED

Sun Jul 23 2023 14:25:22 GMT+0000 (Coordinated Universal Time)

Saved by @nelson22

ls = list of files in directory

git init = initilises a git repository in the current directory

git add . = add all files in the current directory

git commit -m '' = commit files with message

git status = check which files are added and not added

cat names.txt = to see the text inside the file

git restore --staged names.txt = remove added files

git log = see all the commits from history

git reset dgfer4r52345223 = this will reset your repo to that particular version from history (here dgfer4r52345223 is the commit code from git log)

git stash = it stores the files seperately which will not be commited to github history. you need to git add files before stash

git stash pop = this brings back the files which were seperatly stored

git stash clear = this deletes the files which were seperatly stored

git remote add origin = this links the github repo to the project folder through gitbash

git remote -v = this will show all list of current repo

git push origin master = this pushes the code to repo for first time. here origin refers to which url and master refers to which branch

git branch feature = this creates a new branch with the name feature

git checkout feature = this switches the branch to feature
content_copyCOPY