-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change copyright to "Copyright (c) 2014-present Artsy, Ash Furrow" #1523
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1523 +/- ##
==========================================
+ Coverage 87.67% 88.41% +0.73%
==========================================
Files 24 5 -19
Lines 1063 164 -899
Branches 96 0 -96
==========================================
- Hits 932 145 -787
+ Misses 129 19 -110
+ Partials 2 0 -2
Continue to review full report at Codecov.
|
Thanks a lot for contributing to Moya! I've invited you to join the Moya GitHub organization – no pressure to accept! If you'd like more information on what that means, check out our contributor guidelines and feel free to reach out with any questions. |
Thanks @ashfurrow! I am very new to GitHub. My local repository now says "This branch is 1 commit behind Moya:master." This has happened on another project that I forked and pulled. I have tried everything except the correct process to get in sync. Do you have any ideas? Thanks! |
If you clone Moya/Moya (instead of your fork), you can simply Sent with GitHawk |
Thanks @BasThomas. Do I delete current fork? Should I never fork? |
If you don’t have push access to a repository, you have to fork. So for this PR you created you made a fork, but as you now have push access to Moya, you no longer need it. So yes - you can delete the current fork. And no - you have to fork if you do not have push access to a repository. Sent with GitHawk |
@BasThomas Thanks! So for a workflow starting with a new project:
Edit: Tried to get started...Easier said than done. Can you give an assist on the actual process from Github and/or terminal? For example: I had all my 3 of my repositories on GitHub synced to the main master repository and they all stated that they were even. Now one of the three is 2 commits behind. What do I do? |
You need to add a new remote, traditionally called Then check that you have them setup: Then you need to fetch the new commits from the original repo, Then you need to merge those changes from Sometimes you may need to Note: Moya has unique contributing guidelines. Thus, you're able to work from the original repo after having your first PR merged in. However, this is the workflow you will need to use for other projects that you're not a member of. |
Nearly! You don't really have to fork and re-clone (though that will work too). Your fork was made at a specific time, and to continue making pull requests to Moya, you need to "update" your fork, so that it knows about all the commits to Moya since you made the fork. This is actually pretty easy to do, but uses confusing terminology, isn't well documented, and is a bit of "assumed knowledge" that no one usually teaches. So. How do update your fork? We need to be in the terminal and we're going to clone your fork. (One note: I'm using HTTP urls for GitHub in these examples, but you can use SSH urls that begin with > git clone https://github.com/richgabrielli/Moya.git Next we'll change directories to go into the forked repo: > cd Moya Okay, so this folder is "pointing to" your fork. The name for this is "origin" and you can see it by asking git for all the remotes it knows about: > git remote -v
origin https://github.com/richgabrielli/Moya.git (fetch)
origin https://github.com/richgabrielli/Moya.git (push) Okay so we want to point your git to Moya's original repo. This is process is called adding it as a remote. We'll need to give the remote a name, and the convention is to call it "upstream". > git remote add upstream https://github.com/Moya/Moya.git Now verify that both origin and upstream are printed when you run Alright so now all you have to do is pull upstream changes from Moya and then push those exact changes to your fork (remember, everything you've typed into the terminal operates on your local git, not the remote fork). So we can pull changes from Moya and push them to your remote with the following two commands: > git pull upstream master
> git push origin master And that should do it! One word of caution: it's really important that your fork's master branch only ever has commits in it that are also in Moya's upstream master branch. All you need to do to avoid problems is: always work on branches. Whenever you start new work, pull the latest from Moya's upstream and then check out a new branch: > git checkout -b my-new-branch-name I hope that helps – let me know what I can clarify. Welcome to the project, by the way! |
@richgabrielli You can ignore my post and just read Ash's |
They're both good! They're good posts Steven. |
PERFECT!!!! Thanks @ashfurrow @SD10 and @BasThomas. I think I got it. The biggest thing (I think) is that I was missing was the "git push origin master" as the last step to get my local branch synced up to the my repository on the GitHub website! You all were very welcoming and patient with some pretty basic issues I was having. I look forward to being more active! |
Awesome to hear @richgabrielli! I faced similar struggles and wouldn’t have gotten involved in open source if people weren’t patient and supporting. Please remember this experience if you see the opportunity to help another GitHub user one day 🤗 Sent with GitHawk |
Certainly. That command creates a new branch called > git branch my-new-branch-name
> git checkout my-new-branch-name On a higher level, working on features or fixing bugs generally follows the following steps:
I do this on open source projects, as well as projects for work. So what's the point of all this? Well, a |
Thanks @ashfurrow! That makes perfect sense. I do the same on my local Xcode Swift projects with Git. I have my "master" and then I branch to a "new-dev" branch, make my additions / updates and then merge it to "master" |
Last question (I promise)... What happens when I sync masters, branch my dev repository to my local PC and make changes that take some time, merge my local to my remote master and am ready to make a PR. However, in that span the master project has had some changes. Do I need to resync or can I do a PR and you will sort it out with skill and a bit of magic? :) |
GitHub will tell you there are merge conflicts in that case, and you can either fix it on GitHub.com or locally (in the command line or any program you prefer) Sent with GitHawk |
@richgabrielli ^ This. But sometimes you will be lucky enough to submit a PR without needing to resync if the changes don’t affect any files you worked on. Sent with GitHawk |
No description provided.