-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathgitcommands.txt
More file actions
17 lines (17 loc) · 965 Bytes
/
gitcommands.txt
File metadata and controls
17 lines (17 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
git commands
git diff-shows diff between current directory and last commit
git checkout HEAD filename-discard last changes made and restore to the last commit
git add-add to staging area
git status-show changes made
git reset HEAD filename-resets file in stage to same as head commit
git reset commit_SHA-resets till this commit
echo "message">>file-edits the file
git clone https://github.com/ekthapriyesh24/gitcommands.git-copy from github
git remote add origin https://github.com/ekthapriyesh24/loginpage.git-connect to online server
git remote -v-see connected servers
git push origin master-to push to online server
cd-go to top server
git rebase -i HEAD~n for deleting n commits
git add -A add all the changes to the stage(there is also a risk of the addition of all files of git Ignore which are modified unintentionally)
git add -u add all the files which are currently being tracked
git push origin --delete branch -deletes the branch from remote server