RESET BRANCH/FILE
-- force discard —
git reset --hard origin/<davidBranch_name>
example with the master branch
git reset --hard origin/master
-- force discard —
git reset --hard origin/<davidBranch_name>
example with the master branch
git reset --hard origin/master
You can undo git add
before commit with
git reset <file>
or
git reset <directory>
It will not delete any of your files
touch .gitignore
.DS_Store /vendor
ssh -T -ai ~/.ssh/id_rsa [email protected]
Solution 1
#1 Remove the key from your GITHUB repository->deploy
#2 Copy your key from macbook
pbcopy < ~/.ssh/id_rsa.pub
#3 Paste your key in the Github->repository you want to use
Solution 2
you can do a do a git clone against the https url
git clone https://git.com/david/global-helpers.git
Here is the command on how to resolve (modified content)
git rm -rf --cached yourfolder
$ rm -rf .git/refs/remotes/origin # remove all origin/* $ mkdir .git/refs/remotes/origin # create empty origin/ $ git fetch origin # repopulate origin/*
remove lines below from .git/config[remote “origin”]
url = [email protected]:dxxxx/xxxxxxxx.git
fetch = +refs/heads/*:refs/remotes/origin/*
Type following commands
git remote add origin [email protected]:xxxxxx/xxx.git
git remote -v
ssh -Tvvv [email protected]
pbcopy < ~/.ssh/id_rsa.pub
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa (regular unix system)
$ ssh-add -K ~/.ssh/id_rsa (for macbook)
$ pbcopy < ~/.ssh/id_rsa.pub
(for macbook)
Paste key into github
$ git remote add origin [email protected]:xxxxxx/xxxxxxx.git
$ git remote -v
$ git push -u origin master
git init git add . git status git commit -m "First commit" git remote add origin [email protected]:xxxxxx/xxxxxxx.git git remote -v git push -u origin master
cat ~/.ssh/authorized_keys cat ~/.ssh/known_hosts
git remote update
git fetch
Downloads the latest from remote without trying to merge or rebase anything.
git fetch -- all
git clean -f -d
-- force discard local changes —
git reset --hard origin/master
-- force discard —
git reset --hard origin/<davidBranch_name>
git checkout -f <localfile>
git commit -m ‘My commit David Raleche’
git commit --amend
git reset HEAD -file-
git push origin <davidBranch>
git diff --name-only --diff-filter=U
GIT ADDgit add <file>
git commit -m “message of your commit” git push origin
git reset <file>
git reset
git reset --soft HEAD~1
git reset --hard HEAD^
(VERY DANGEROUS)
git checkout --track origin/ECOM-307
git diff –name-only –diff-filter=U
git log –graph
git log –oneline