Unterabschnitte von VCS
Anbieter
Atlassian
…
Git-Repositories
Unterabschnitte von Git-Repositories
Basics
Init
git init
Zustand abfragen
git status
add to stage
-
git add -A
-
git add -u
remove from
git rm --cached <file/pattern>
Remove pycache
git rm --cached -r **pycache**/
commiten
git commit -m 'update node-red'
Remote Server
git remote add origin git@github.com:user/repo.git
RemoteRepo aktualisieren pushen zum Remot-Repo
-
ssh-keygen -t rsa -C "your_email@example.com"
-
cat ~/.ssh/id_rsa.pub | pbcopy
-
git push
-
git push --force --set-upstream origin master
vom RemoteRepo ziehen
-
git pull
-
git pull --recurse-submodules
git log
git log --all --graph --decorate --oneline
git log --all --graph --decorate
hard reset
git fetch origin master
git reset --hard origin/master
Backup aller repositories ziehen
USER=**USER**;
curl --user \${USER} 'https://api.bitbucket.org/2.0/repositories/**TEAM**?pagelen=100' | grep -o '"git@[^ ,]\+' | xargs -L1 git clone
Quellen
Scripts for ...
Git pull force
#/bin/sh
# Fetch the newest code
git fetch
# Delete all files which are being added,
# so there are no conflicts with untracked files
for file in `git diff HEAD..origin/master --name-status | awk '/^A/ {print $2}'`
do
echo "Deleting untracked file $file..."
rm -vf "$file"
done
# Checkout all files which have been locally modified
for file in `git diff HEAD..origin/master --name-status | awk '/^M/ {print $2}'`
do
echo "Checking out modified file $file..."
git checkout $file
done
# Finally merge all the changes (you could use merge here as well)
git pull