Untitled
unknown
plain_text
2 years ago
1.8 kB
6
Indexable
$ ssh-keygen -t ed25519 -C "your_email@example.com" eval “$(ssh-agent -s)” ~/.ssh/config touch ~/.ssh/config vim ~/.ssh/config Host * AddKeysToAgent yes IdentityFile ~/.ssh/id_ed25519 ssh-add ~/.ssh/id_ed25519 add ssh to github cat ~/.ssh/id_ed25519.pub ssh -T github@github.com git clone (repo link) git config --global user.name "Haseeb Azhar" git config --global user.email haseebazhar6389@gmail.com git config --global core.editor "code --wait" git config config --global -e git remote add origin repo.link git push -u origin master git init (initialise git repo) git add file1 file2git ls-files (to list all the files in git repo) git rm --cached -r directoryname/ (to remove from git staging only) git commit -m "initial commit." (first change) git add file1 (after making bug fixes to file1) git commit -m "Fixed the bug that occurred in file1." (now we have 2 commits in our repo) git add file2 (after deleting cuz we realised we didnt need it) git commit -m "removed unused code." (now we have 3 commits,1 file) git commit -a -m/ -am "to commit changes without staging/ adding them" mv file2.py index.js (renaming files) echo folder_name/ > .gitignore (to ignore the files)git config --global diff.tool vscode git config --global difftool.vscode.cmd "code --wait --diff $LOCAL $REMOTE" git config --global -e git log git log --oneline (excludes user and time of changes) git log --oneline --reverse git show d601350 (unique id to display details of a commit) git restore --staged filename (to restored files added in stage) git push (after making changes locally) git pull (after making changes remotely) git reset (to reset a stage) git reset HEAD~1 (to reset a commit) git checkout -b branch-name (to create a new branch) git checkout branch-name (to switch bw branches)
Editor is loading...