Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm beginner on git source control I have web application done by angular 7

exist on git source control

AND I need to pull last changes to be same changes and files on local and server same .

so I will write

E:\PartDetails> git pull origin master 
but I notice I have 7 files changes on angular files so

What I do on files changes before Pull last changes to web application files from server ?


see image below ;
File sharing and storage made simple[^]

What I have tried:

I try more coomands as
E:\PartDetails> git commit 

or
<pre>E:\PartDetails> git status
Posted
Updated 5-Jul-20 18:37pm

1 solution

There are many ways to fix it.
Option 1 :

A. Do local stash save :> git stash save
B. Then do :> git pull origin whaterver-remote-branch-name
C. then merge local changes :> git stash pop

D. Resolve conflicts if any, and then test your changes local, so that you are good for commit and nothing else is broken/erased.

Once you are done with test, sometimes simple visible test will do too.
E. Add your changes :> git add . or git add filenames

Push to same branch :: ideally you shouldn't do this look "Or" part
F.Add commit comment :> git commit -m "meaningful comment so you know what have changed now, make sure that you mention merged content"
G.Push your changes :> git push origin whaterver-remote-branch-name

Or push changes to remote branch
F'.create new branch :> git checkout -b feature/your-changes-to-remote-branch
G'.Add commit comment :> git commit -m "meaningful comment so you know what have changed now, make sure that you mention merged content"
H'.Push your changes :> git push origin feature/your-changes-to-remote-branch
I'. Create Pull Request
Option 2 :
Skip stashing, do git pull, then resolve conflict, then proceed with push.
Step B, D, E, F or B, D, E, F', G', H', I'

Option 3 :
Commit your changes to new branch and then create PR to master/origin branch.
E, F' G', H', I'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900