Home > Back-end >  Create Collaboration Project using GitHub and VSCode
Create Collaboration Project using GitHub and VSCode

Time:09-27

I have to work on a school project in a team and we've decided to use GitHub & VSCode to edit the code. I am a complete Noob in using GitHub & VSCode as I only every coded alone. I created a repository and I have invited my teammate as a collaborator. I also cloned the repo to both our laptops and we both can commit changes, but if I commit a change his VSCode doesn't get refreshed.

I am sorry but could someone explain what options we have? I know that you can pull changes but I wanted both to be on the original repository and pulling seems to give me a error because I pull from and to the same branch.

Any help is greatly appreciated!

CodePudding user response:

I also cloned the repo to both our laptops

That means your VSCode is linked to the same remote repository.
Since a git commit is a local action, you need to push.

If you are both working on the same branch, you will also need to pull in order to fetch and merge changes pushed by your colleague.
You can trigger that through the Git Status Bar.

CodePudding user response:

The other command to look into is pull

The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into your local repository is a common task.

The best strategy is to create branches for the set of additions etc you intend to add to the master and then merge them in as you complete the work. That means that if there are conflicts then it happen at the branches and those conflicts then can be resolved. Think of your working copies as just that working copies that can be refreshed totally separately from what is online.

Good luck with your project, what you['re doing is a very sensible and professional approach to problem solving and collaborating.

  • Related