GitHub: pulling and pushing project with my collaborator - github

I'm working on a project created by a friend. He created his project on Intellij and connected it to a Repository on GitHub. Committing and pushing works, but i (a collaborator) don't understand how i can pull the project from git, and doing merges/pushing/committing. Any help? I've watched plenty of tutorials, but everyone only address the problem of connecting a project to github.

Are you able to clone the project?
Make sure you are actually under the collaborators and you can access it trough Github.
Then clone, steps here.
After making changes go to the "VCS"->"Git"->"Commit", then "Push"
Then go to "VCS"->"Git"->"Merge Changes"
Select the branch you want to merge from
Resolve any conflicts and merge.

Related

How should I correctly push my project to github using eclipse?

I work in Eclipse. I have a maven project and usually, I commit and push it to my remote repo on GitLab. Now I want to push this project to a brand new GitHub repo. I've already created an empty repo on GitHub and pulled it to my local machine. So I already have a corresponding empty local repo too. The thing is I don't understand how to push my project to my new local repository and then push it to Github.
Usually, I use Egit but I can use the command line as well.
Maybe my logic is wrong? What should I do to have my project on GitHub then?
Thank you in advance.
I'm not sure if I understand your problem, if you were already pushing to GitLab with Egit. Have you tried to do it yet? Are you getting errors?
You should be able to use Egit the same way by committing to your local repo and then pushing to GitHub instead of GitLab.
The only difference would be having to use your GitHub credentials (or associating your SSH key to GitHub), and then specifying your GitHub repository.
https://wiki.eclipse.org/EGit/User_Guide#GitHub_Tutorial
The only thing that you had to keep in mind is to make sure your branch specs match. I think you might see "HEAD" by default, but you can change that to "master" if that's all you have.

How to check which person clone my project in github

I have my projects on github, and they're public. How would I know that my projects have been cloned, and by whom?
There is now way of telling who have cloned your project.
But, Github provides basic statistics about visitors and clones in 'Graphs' option on your repository. Here is a link.
Also you can see who has forked your project:
A number showed on top right corner on your repo present on Github.
Go to Graphs->Members to check out who forked your repo.
Hope this helps.

Correct process to merge fork changes into GitHub

I am new to GitHub. I don't know the correct process to merge my changes with the upstream. I followed following steps using EGit (I like to use it because I find it simple). Please help me.
On GitHub I created a fork.
For my fork I cloned a repository in Eclipse and imported respective projects.
In remotes, I added one more for the main project say Upstream(from where I forked) on GitHub.
I added some changes into my local repository.
How can I do the following part? -
Now in the meantime other people added some changes to the upstream. Now I want to integrate my changes(in the fork I created) to the latest changes(upstream) using EGit and push it to my repository and send a pull request.
Please help me.
create another remote corresponding to your fork in Eclipse
publish (push) your changes into your fork repo on github
create a merge request from the web interface in the original github repo, pointing to your changes on github
There is the procedure, how I do it.
GitHub browser UI
delete your fork with too much mess, if exists - this is in your Settings -> Danger Zone, the button is in upper menu bar in the root of fork
fork for you a new one on the foreign page, where I have access
open newly created fork and copy URI to the clipboard
Git perspective in Eclipse
create clone of your fork in my GUI Eclipse
Create a new branch in local branches and activate it
Import project from working tree in Eclipse as general project from Git perspective to actual workspace
do changes, integrate your important files to the general project (add to index etc.)
commit, push
GitHub browser UI
create Pull request from your fork directly from actual branch (recommended) or after merge in master branch
Notice, that in the picture is merge branch selected. In our real case is better to use the name, which is more descriptive.

Synchronizing copied repository with GIT repository

I have copied repository from my team member and I want to synchronize with GIT repository.
Please keep in mind that I am new to GIT and I only have URLs of the repository where I need to synchronize. I need help to connect my repository with GIT repository. I have not imported any repository and I have just copied that. I will be able to push or pull or merge etc. only if my project is synchronized with remote repository. Please let me know that how can I synchronize. Thanks
It's unclear from your question whether you are trying to simply keep two copies of the same repository synchronized or something else.
If it's the first, then what you want to do it a git clone. Your changes should be git commit, to get remote changes you should git pull and to push your changes to your co-worker's repository, you should git push.
Depending on your operating system, there are different front-ends for Git. I gave you the command-line version. I saw you tagged your questions with the eclipse tag, which suggests you are trying to do this inside Eclipse. In that case, you might find EGit useful. See the EGit User Guide here.
If all this sounds too complex for you, you should first Read The Manual - that is, check out the Getting Started chapter of the Git Documentation.
I found the solution. I had to go in team-> share projects. then "create a new repository location" and paste the url of git repository. then team->share project-> git and add the repository. Now my copied repository is linked/connected with my git repository and I am able to synchronize my repository.

egit for eclipse: How do I put my existing project in the clone of my buddies repo?

My buddy gave me his git address for the project we are going to work on. In Eclipse using egit I cloned his branch.
So now in my Git view I have my own repository I created of an existing project. I want this existing project to be on my buddies branch so we can both check it out and have it in our repo.
Unfortunately I am using Windows to do this because we are developing a game and I do all of the art & animation in addition to programming. I would feel much more comfortable on the cmd line than using this plugin..
Any help is much appreciated!
The notion of repo and branch are quite different.
If you have a clone of our buddy's repo, you can work on a branch named like the one your buddy uses (by default 'master' if he hadn't created any other), and everything you will push will be added/merged to the remote branch in the remote repo.
For more on Egit, see this "Git with Eclipse (EGit) - Tutorial", and check if yuo can push at least one file, that your colleague will be able to pull from the remote repo and see directly in his branch.