Twindle: Documentation: How to sync the main repo and own repo in GitHub.

Created on 14 Oct 2020  路  14Comments  路  Source: twindle-co/twindle

To sync the main repo and own repo,

  1. pointing to the main repo and pull from it, for that create a new remote in local for pointing the main repo .
    git remote add upstream https://github.com/twindle-co/twindle.git
  2. To download all the changes and commits from main Repo.
    git fetch upstream
  3. The current branch will be updated to reflect the merge.
    git merge upstream/main
  4. push the changes to own repository.
    git push origin main
documentation

Most helpful comment

You have two options

  • On your Git in VS Code, click on the three dot option and click push/pull
    OR
  • In your terminal do this 'git push' or 'git pull'

Pull will get the latest changes from GitHub
And push will send your latest changes to GitHub

All 14 comments

Great, @praveen2896 thanks for documenting this! @Sheetal777 or anyone else could verify?

You have two options

  • On your Git in VS Code, click on the three dot option and click push/pull
    OR
  • In your terminal do this 'git push' or 'git pull'

Pull will get the latest changes from GitHub
And push will send your latest changes to GitHub

@thunder-coding Could you collaborate on making sure this is a step by step explanation so that a newbie can understand? The discussion is about how to keep the forked repo in sync before creating PRs. This will be synced up with the wiki once it is done!

AzureAD+SwatiAnandRao@LAPTOP-MJRBVINQ MINGW64 ~/Desktop/GIT/twindle (main)
$ git push origin main
*remote: Permission to twindle-co/twindle.git denied to SwatiRaoDataEnthusiast.
fatal: unable to access 'https://github.com/twindle-co/twindle/': The requested
URL returned error: 403
*

I am getting above error when I am trying to push into origin?

@SwatiRaoDataEnthusiast

You are making a commit directly to main repo. You have to first commit to your forked repo then you can make a PR from Github to the main repo.

I have attached some snaps below.

Here you can see my origin is my forked repo link. You can check your's by running git remote -v.

image

Then after making changes you can run git status commands to check what changes you have made.

image

Here you can see I have made some changes in 'pranav.md' file.

So to push these changes to my forked repo I can run these commands.

  1. git add .
  2. git commit -m "Updated pranav.md"
  3. git push -u origin main

image

Now they will be reflected to my forked repo.

image

Now you can make a PR.

image

@johnjacobkenny Please pin this issue, as it is hard to find it now.

Could someone follow up on getting this into FAQ on a priority

@SwatiRaoDataEnthusiast

You are making a commit directly to main repo. You have to first commit to your forked repo then you can make a PR from Github to the main repo.

I have attached some snaps below.

Here you can see my origin is my forked repo link. You can check your's by running git remote -v.

image

Then after making changes you can run git status commands to check what changes you have made.

image

Here you can see I have made some changes in 'pranav.md' file.

So to push these changes to my forked repo I can run these commands.

  1. git add .
  2. git commit -m "Updated pranav.md"
  3. git push -u origin main

image

Now they will be reflected to my forked repo.

image

Now you can make a PR.

image

Just to add onto what @pranavgoel29 has said, you can change the path for origin using
git remote set-url origin _your forked repo url here_

@MumbiGachomba04 next time you can use the "Quote reply" option in the menu for any comment

It should be closed?

450 if anyone picks up can close both issues

@johnjacobkenny documentation related thing can be moved to appropriate file under docs & this issue can be closed.

I'll close this since there is another issue to add it to docs #450

Was this page helpful?
0 / 5 - 0 ratings

Related issues

piratelicorne picture piratelicorne  路  7Comments

proful picture proful  路  5Comments

tusharkandpal picture tusharkandpal  路  3Comments

proful picture proful  路  4Comments

proful picture proful  路  4Comments