Follow Along as I Stumble on the Path to Learning RoR

Git

Changing URL for Remote

I changed the hosting of my repo from Github to Bitbucket.  I like Bitbucket because not only does it house the code and history, but also it ties in with a bug tracker that allows for tracking (and assigning) of bugs, but also collaboration with developers.

To remap my remote repo, I did this:

git remote set-url [example] [git://github.com/user/test.git]

where:

[example] = repo name

[git://github.com/user/test.git] = new repo url


Git Commands

Here are the git commands I use most often (I use git GUI so I don’t usually type the commands git add, git commit, & git push to move files):

  • git branch – tells you what branch you are currently in
  • git checkout [branch] – switch branches
  • git merge [branch] – bring in the code from the named branch, into the current branch
  • git pull [repository] [branch] – pull my files
  • git push [repository] [branch] – push my files
  • git stash – store local changes (usually when there is a merge conflict)
  • git stash apply (retrieve the stashed local changes)

for me:
[repository] = origin
[branch] = master and dev