TWiki> Main Web>ArnabsGitHubInstructions (revision 2)EditAttachPDF

Arnab's GitHub Instructions


Here you can find useful instructions for gitHub in Q&A format.

How to fork a repository?
How to add an existing project to GitHub using command line?

1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.

2. Open Terminal.

3. Change the current working directory to your local project.

4. Initialize the local directory as a Git repository:

git init

5. Add the files in your new local repository. This stages them for the first commit:

git add .

6. Commit the files that you've staged in your local repository:

git commit -m "First commit"

7. At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.

8. In Terminal, add the URL for the remote repository where your local repository will be pushed:

git remote add origin remote repository URL

# Sets the new remote

git remote -v

# Verifies the new remote URL

9. Push the changes in your local repository to GitHub:

git push origin master

How to update/Sync a gitHub repository?

1. Clone your fork:

git clone

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

cd into/cloned/fork-repo

git remote add upstream git://

git fetch upstream

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

git pull upstream master

4. Push changes to your forked area:

git push

How to

-- ArnabPurohit - 2018-06-02

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r2 - 2018-06-13 - ArnabPurohit
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback