Git Command
Setup
git config --global user.name "eggoez"
git config --global user.email "@gmail.com
New
mkdir /path/to/your/project
cd /path/to/your/project
git init
git remote add origin https://*.git
New Files
echo "Baguz Ach" >> contributors.txt
git add contributors.txt
git commit -m 'Initial commit with contributors'
git push -u origin master
Existing
cd /path/to/my/repo
git remote add origin https://*.git
git push -u origin --all # pushes up the repo and its refs for the first time
git push -u origin --tags # pushes up any tags
Normal
git init
git add *
git commit -m "what the commit"
git remote add origin http://*.git
git pull origin master
git push origin master
Change
git remote set-url origin git://new.url.here
Update/Sync forked repo dari original repo
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git remote -v
git fetch upstream
git checkout master
git merge upstream/master
Ganti Author
git clone --bare http://.git
cd repo.git
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
git remote add origin https://username:password@gitdomain/.git
git push --force --tags origin 'refs/heads/*'