Git   188411

« earlier    

Using multiple accounts with git or Github (Example)
"If you have mutliple people using the same computer, or different user accounts for different repos it can be rather frustrating trying to figure out how to switch accounts if your on OSX and find your not being prompted for your login info because it's been cached."

helper = osxkeychain
useHttpPath = true
troubleshoot  git  programming 
yesterday by tinatth
version control - How do I force "git pull" to overwrite local files? - Stack Overflow
I think this is the right way:

git fetch --all

Then, you have two options:

git reset --hard origin/master

OR If you are on some other branch:

git reset --hard origin/<branch_name>


git fetch downloads the latest from remote without trying to merge or rebase anything.

Then the git reset resets the master branch to what you just fetched. The --hard option changes all the files in your working tree to match the files in origin/master

[*]: It's worth noting that it is possible to maintain current local commits by creating a branch from master before resetting:

git checkout master
git branch new-branch-to-save-current-commits
git fetch --all
git reset --hard origin/master

After this, all of the old commits will be kept in new-branch-to-save-current-commits. Uncommitted changes however (even staged), will be lost. Make sure to stash and commit anything you need.
git  workflow  how  howto  How_to  coding 
yesterday by catichenor

« earlier    

related tags

acm  adr  algorithm  alibaba  application  architect  architecture  atom  automation  awesome-list  aws  backup  bash  bestpractice  bestpractices  binaries  book  books  branch  branching  ci-cd  cli  clients  cms  code  coding  command  commandline  completion  computer_science  config  console  contentmanagement  continuous-integration  control  crypt  cvs  data  datascience  datastructures  decision  delete  demo  deployment  desarrollo  dev  development  devops  dfstudio  distribution  docker-compose  docker-machine  docker  documentation  dotfiles  dreamhost  dropbox  dvcs  editor  file-system  functional-programming  functional  functionalprogramming  gerrit  git-clients  git  github  github_repos  go  golang  google  gui  history  hosting  how  how_to  howto  immutability  immutable  information  interesting  internals  intro  ischool  it  javascript  keychain  learning  libgit2  linter  linux  list  mac  markdown  metodología  model  monorepo  msim  nodejs  opensource  opinion  oss  osx  package  pairprogramming  password  process  productivity  profdev  programming  python  qrcode  r  react  rebase  reference  references  remote  reset  restore  revert  rstats  ruby  scm  security  setup  shell  shiny  software-dev  software  sourcetree  static  svn  tip  tips  todo  tool  translate  troubleshoot  trunk  tutorial  type:collection  type:game  type:tool  ui  usecase  vcs  versioncontrol  vscode  web  webapps  webdesign  windows  workflow 

Copy this bookmark: