Answer the question
In order to leave comments, you need to log in
How to deal with git?
Hello! Now I am on my last term in the 1st web studio, this is my first job as a programmer, before that, of course, I had no experience in team development. The only problem I'm having and can't beat is git itself.
Usually here is what I do:
1. Create a branch in bitbucket , inherit from master
2. Connect to the container via ssh
3. Switch to the master branch (git checkout master), and pull from the remote master: git pull origin master
4. Do a fetch new branch: git fetch origin NewBranch
5. Move to branch: git checkout NewBranch
6. (working on some files)
7. Index changes in these files:
git add path/to/file
8. Commit: git commit -m " commit"
9. I push to the branch: git push origin NewBranch
This algorithm was literally written for me step by step. However, I constantly encounter all sorts of funny surprises - sometimes I can’t switch to a branch, now a new problem has been added - my pull requests cling to a bunch of commits from other branches and for other days.____. As a result, it turns out that I will complete the task in an hour, and I toil with the git for 3-4 hours. Now it is the situation with foreign or old commits that seems to be the most problematic, since such pull requests are rejected by themselves.
Please help me figure it out, and explain what exactly I'm doing wrong and how it should be. Just please do not send git or githowto to the site, of course I have been there many times.
Answer the question
In order to leave comments, you need to log in
Or involve knowledgeable workmates to explain with real examples. Or learn git, there is nothing complicated (for the level "created a feature - completed a feature").
It's hard to guess what your problem is without the error text. As for "other people's changes", do a pull before any work on the remote branch, and if there are already changes, then do a rebase of your branch into a new commit.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question