sed -i 's/[[:space:]]*$//' FILE
Sync a fork of a repository to keep it up-to-date with the upstream repository.
Configure a remote that points to the upstream repository in Git.
- Open Terminal.
- List the current configured remote repository for your fork.
$ git remote -v
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
- Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
- Verify the new upstream repository you've specified for your fork.
$ git remote -v
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
Sync repo: Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.
git fetch upstream
git checkout master
git merge upstream/master
cat ~/.ssh/id_rsa.pub | ssh git@nas "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
cd project
git filter-branch --index-filter 'git rm --cached --ignore-unmatch *.iso' HEAD
cd /srv/git
mkdir project.git
cd project.git
git init --bare
cd project
git remote add origin root@server:/git/project.git
or
git remote add origin /git/project.git
git push --set-upstream origin master
git pull