0

I'm looking for a way in my gitkraken how to update my cloned repository according to the official repository. because my cloned repository is a few commits ago.

Lucas L
  • 43
  • 1
  • 7
  • `git pull` should do the trick, the button with the down arrow on it. Choose the remote of the official repo. – msanford Apr 04 '18 at 15:59
  • Possible duplicate of [How do I update a GitHub forked repository?](https://stackoverflow.com/questions/7244321/how-do-i-update-a-github-forked-repository) – phd Apr 04 '18 at 16:19

1 Answers1

3

Aside: Gitkraken and tools like it are useful, but the downside is that they often obscure what's actually going on. It's hard to understand what these tools are doing for you because of all the visual layers. I highly recommend learning the CLI commands first, and then using GUI tools for the convenience.

Your remote is probably already configured, given that this is a clone. But it's good to check just in case:

> git remote -v
origin  <your fetch location>
origin  <your push location>

Next, make sure that the branch you have has an upstream.

> git status
On branch <your branch name>
Your branch is ahead of 'origin/<remote branch name>' by X commits.

If you got results similar to the above, then you can just use git pull and git push to get new commits from/send new commits to your remote repo.

If you did not get results similar to the above, then either you have not yet configured your remote and/or your local working branch has no upstream branch.

See 2.5 Git Basics - Working with Remotes for more information about setting up your remote and 3.5 Git Branching - Remote Branches for more information about linking your local branch to a remote branch.

For GitKraken-specific documentation on working with remotes and branches, see GitKraken Support: Pushing and Pulling

JDB
  • 25,172
  • 5
  • 72
  • 123
  • 1
    +1 for not using a GUI. Also, picking up _"Version Control with Git"_ by Jon Loeliger and Matthew McCullough was life-changing. – msanford Apr 04 '18 at 16:02
  • Personally, I really like using Sourcetree. It makes it super easy to review the diffs. But, when I was first learning git, none of the GUIs made any sense to me. It wasn't until I learned the CLI that everything started making sense to me. – JDB Apr 04 '18 at 16:04
  • I actually really dislike SourceTree (for example, as of a recent-ish update, it's _impossible_ to force push now from the GUI, which I need to do regularly while rebasing private topic branches. That said, I'm all for "whatever works for you". As for diff reviewing and patching (committing parts of a file) that's _much_ easier in a GUI, but I usually use my IDE's inbuilt differ for that. – msanford Apr 04 '18 at 16:10
  • 1
    Yeah, I use SourceTree to review diffs and occasionally local commits, and the CLI for everything else. – JDB Apr 04 '18 at 16:14