Git Learning
git init
git status
git add filename.txt
git status
git commit -m “message for the commit”
git add “*.filetype”
git log
git remote add origin https://github.com/try-git/try_git.git creates a remote repository named origin.
git push -u origin(dest) master(src)
The name of our remote is origin and the default local branch name is master. The -u tells Git to remember the parameters, so that next time we can simply run git push and Git will know what to do
git pull origin(remote branch name) master(local branch name)
git diff HEAD
git diff --staged
git reset foldername/filename resets the unstaged commit
git checkout --<target> So you may be wondering, why do I have to use this '--' thing? git checkoutseems to work fine without it. It's simply promising the command line that there are no more options after the '--'. This way if you happen to have a branch named octocat.txt, it will still revert the file, instead of switching to the branch of the same name.
git branch branch_name creates a new branch
git checkout -b new_branch creates a branch with name new_branch and checkouts it
git checkout new_branch switches to new_branch
git rm ‘*.txt’
git merge new_branch goto the master branch and merge the local_branch named new_branch
git branch -d new_branch(deletes the branch only when changes are merged. delete before merge use the option --force or -f along wih -d or directly use -D )
git stash
git stash apply












