Not sure if I understand correctly. You want to put your commits on top of latest commits from nim repo? The following should work.
git remote add nim https://github.com/nim-lang/Nim
git pull --rebase nim master
My workflow is:
I keep 2 sources, visible with git remote -v
origin https://github.com/mratsim/Nim (fetch)
origin https://github.com/mratsim/Nim (push)
upstream https://github.com/nim-lang/Nim (fetch)
upstream https://github.com/nim-lang/Nim (push)
To sync with devel
git checkout devel
git fetch upstream devel # get the data from Nim devel
git pull upstream devel # Fast forward upstream devel in my own devel copy
git push # Push the change in my remote copy
Just create branches against your devel, and delete them once submitted and merged, you don't need to reset and reuse the same one.
so the cmds are
git clone https://github.com/nim-lang/Nim/
git checkout devel
git fetch upstream devel
git pull upstream devel
git push
git remote -v lists sources that are connected to my local copy
but how do I connect them in the first place?
and how do I resolve changes that I have already made to my base branch so it will stop complaining about merge conflicts?
just assume that I am a complete git newb and don't know what any of these commands do
also is there any way to add new lines in this forum without double spacing?
this is the exact error message when I try git checkout devel
error: you need to resolve your current index first
lib/pure/pegs.nim: needs merge
this is one of my commits that has now been been overridden in devel how do I resolve/remove it?
I also recommend including the branch name in your shell prompt. For bash, I have in my .bashrc:
PS1='\u@\h:\w$(__git_ps1 " [%s]")\$ '
Depending on your distribution, you may need to install a package or source some shell script to the __git_ps1 command. For example, I need
source /usr/share/git-core/contrib/completion/git-prompt.sh
in my .bashrc.
If you have this set up, the branch name would change from devel to something like devel|MERGE in the prompt. That way you can see if Git put you in the "merge mode" without even checking git status.
Ok I managed to update my branch to be inline with devel.
But now it says I'm 13 commits ahead.
And whenever I try to make a pull request it includes all those commits in the pull request.
This is what I get when type git remote -v
origin https://github.com/solo989/Nim.git (fetch)
origin https://github.com/solo989/Nim.git (push)
upstream https://github.com/nim-lang/Nim.git (fetch)
upstream https://github.com/nim-lang/Nim.git (push)
and when I try to rebase to declutter up all those commits
git rebase
I get
Cannot rebase: You have unstaged changes.
Please commit or stash them.
despite git pull upstream devel telling me Already up to date.
and git push telling me Everything up-to-date
well now my repository is even more of a mess
somehow I managed to merge some of araqs commits into my own branch and it's claiming I co-authored them
https://github.com/solo989/Nim/
if anyone could give me the commands to get my repository back exactly to devel it would be much appreciated
deleted and restarted my repository
still curious what commands would have done that for me without starting from scratch
To your specific question, the exact commands to get my repository back exactly to devel
git reset --hard devel
git clean -f
but I think what you actually need is to resolve merge conflicts... which is just edit the files and then git add <file> and then git commit
You problem is not specific to nim, but general git usage. You have mentioned a lot of terms, but you have no idea what they are supposed to do. There are a lot of resources about git on the Internet. I would suggest slowing down your peace and spent few hours to grab the basic of git. I remember I learn git from this course at code school long time ago and now it become part of pluralsight =]
git checkout devel # your version of devel
git reset --hard nim-lang/devel # reset to nim-lang/devel
git push --force # push to github