Skip to content

Github FAQ

Kaushal Dhruw edited this page Apr 28, 2018 · 6 revisions

Remove tracked .idea files

Below commands will add .idea to .gitignore file and remove all files in .idea from index if already staged. Then commit and push to the current working branch.

echo '.idea' >> .gitignore
git rm -r --cached .idea
git add .gitignore
git commit -m '(some message stating you added .idea to ignored entries)'
git push

Syncing a fork

1. Clone your fork:

git clone LOCAL-FORKED-REPO-URL

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream https://github.com/UdacityAndroidDevScholarship/quiz-app.git
git fetch upstream

3. Updating your fork (local) from original repo to keep up with their changes:

git merge upstream/BRANCH-NAME BRANCH-NAME (or)
git rebase upstream/BRANCH-NAME BRANCH-NAME 

we need to manually run this command for each branch.Resolve conflict if any and then do commit.
Rebase - Rewrite your given branch so that any commits of yours that aren't already in upstream/branch-name are replayed on top of that other branch.

4. Updating your fork (remote) with your local state to keep remote fork up to date:

git push origin BRANCH-NAME #for pushing a branch
git push --all     #for pushing all branches

You may need to use the -f the first time after you've rebased.