You can undo git add
before commit with
git reset <file>
or
git reset <directory>
It will not delete any of your files
.gitignore could be useful before executing git add *
- Step 1
touch .gitignore
- Step 2
.DS_Store /vendor
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-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 push origin master ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Critical command line to address the issue –
Ensure ssh-agent is enabled:
eval "$(ssh-agent -s)"
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